Progress report: Browsing MySource Matrix within MySource Mini
29 JanWe are currently developing a bridge between MySource Mini and MySource Matrix so that MySource Matrix content can be brought into a MySource Mini system. When this development is complete you will not only be able to browse your MySource Matrix system from MySource Mini, but also:
- Link to Matrix pages from within MySource Mini WYSIWYG content
- Create a new link between a Matrix page and a MySource Mini page, giving the Matrix page a MySource Mini URL
- Edit Matrix pages within the MySource Mini interface via a new Matrix simple edit interface
- Apply MySource Mini metadata, designs, permissions etc. to a Matrix page through the standard MySource Mini interface
To create a connection between MySource Matrix and MySource Mini, you will first need to configure the MySource Matrix SOAP interface. Once you have the URL of the SOAP server, you can use a new Connection wizard within MySource Mini to bridge the two systems.
Along with the standard fields, the required fields for this connection are:
- The URL of the SOAP server you configured within MySource Matrix
- A username and password to use for connecting to the SOAP server
- The ID of an asset within MySource Matrix to use as the root node of the connection
Currently, development has been completed to allow you to browse your MySource Matrix asset tree from within MySource Mini. Work is now starting on the remaining features around linking and editing of MySource Matrix content.
But you want some proof of course.
This image shows a simple MySource Matrix asset tree with a number of different asset types.
Note that the number in brackets is the asset ID and not the number of children.
This image shows the asset tree being browsed from within MySource Mini, using the Site asset as the root node of the connection.
To achieve this, we've made an important addition to the MySource Matrix SOAP API. You are currently able to retrieve all the information you require to build an asset tree, but we've added a new API functionGetAssetsInfo() that allows you to pull out this information in one call to significantly improve performance.
This is an example of how you use the new API function:
<?php
$soap_url = "http://[SYSTEM_ROOT_URL]/_web_services/soap-server?WSDL";
$authen_info = array (
'login' => root,
'password' => root,
);
$client = new SoapClient($soap_url, $authen_info);
$request = array(
'AssetIDs' => [Root AssetID],
'FinderAttributes' => array(
'Children',
'type',
'name'
)
);
$assetsInfoResult = $client->GetAssetsInfo($request);
?>
This is what the returned result looks like:
Array (
[0] => Array (
'AssetID' => '90',
'AssetType' => 'backend_user',
'AssetTypeAncestor' => 'user',
'AssetName' => 'Dan Green',
'AssetChildren' =>
array (
0 => '91',
1 => '92',
),
[1] ......
)
Please note that this new SOAP API function is not yet available in a stable release of MySource Matrix, but will be in a future 3.26 release.
PHP_CodeSniffer 1.2.2 released
27 JanPHP_CodeSniffer version 1.2.2 has just been uploaded to PEAR and is now available to install. Most of the changes are behind-the-scenes, but some of the highlights are:
- An interactive reporting mode to check large code bases and make changes as you go
- Closure support added into the core so sniffs can now check rules for PHP closures
- A completely rewritten reporting system to make everything much easier to extend
- Sniff violation codes that will be used to allow overriding of error messages in the future
All new features have been fully documented and are available on the PHP_CodeSniffer documentation page.
You can view the full changelog on the PHP_CodeSniffer download page.
MySource Mini patch 9049 goes RC for personal users
22 JanWe pushed MySource Mini patch 9049 from beta to RC late yesterday, so personal sites should have received the update overnight.
The patch is later than expected as we found a few issues during our beta testing phase (thanks beta testers!). We also held it back to fix up a couple of issues found during the change of year from 2009 to 2010 with date formats, and the Christmas / New Year break didn't help the timeline either. But it is available now and highly recommended.
We've also updated our MySource Mini download page so you can grab a free VM of the new version to play around with.
In addition to the normal features and bug fixes, this patch brings a completely minimised JavaScript interface to MySource Mini, greatly improving interface performance. We've also improved the caching of the editing interface images to cut down the number of requests that MySource Mini makes while editing. This should really help remote content authors, especially those working internationally.
For a full list of changes, view the patch notes for patch 9049.
Updating multiple metadata values in a single JavaScript API call
19 JanThe MySource Matrix JavaScript API now has a new function, setMetadataAllFields(), which accepts an array of metadata values and sets them on a single asset in one call. This function will be made available in version 3.26.1, due out on the 8th of Feb 2010.
/**The JavaScript API could always be used to set a single metadata value for an asset, but we found ourselves sending many requests to the API to set up to 15 different metadata values from our custom frontend interfaces. The overhead of creating connections for 15 requests, and the overhead of performing the same action 15 times within MySource Matrix, left us searching for a new solution.
* Set metadata values of multiple fields for an asset
*
* @param string asset_id Id of asset to set metadata for
* @param array field_info Field Ids and their values
* @param function dataCallback Custom callback function
*
* @version $Revision: 0.1
*/
function setMetadataAllFields(asset_id, field_info, dataCallback)
With this new function call, all metadata fields and their corresponding values are provided in one go, so that there is only a single connection no matter how many metadata values you have to set. Internally, MySource Matrix only needs to acquire and release metadata locks once, reducing the number of DB queries being executed. An even bigger saving is made by not having to regenerate the metadata content file each time a metadata value is set, saving DB queries, disk I/O and PHP processing time.
If you've got a few metadata values to set on an asset, all these savings will add up to a significant performance improvement. Even just setting 5 metadata values could take almost 10 seconds (depending on a lot of factors) while this new function call can return in less than 2.
Like the call that is made to update a single metadata field, this function will return an error if it fails to update any of the fields.
Updating your code to use this new function is pretty easy. The following two code blocks show the old and new way of setting multiple metadata values for an asset.
The first shows the existing way you would be setting 3 metadata values for an asset:
<script type="text/javascript">
window.api_key = 'XXXXXXXXXXXX';
// Asset ID of the asset we are updating
var assetid = "123";
// Update the metadata of the asset
// Metadata field 1000 = Title
// 1001 = Description
// 1002 = Keywords
setMetadata(assetid, "1000", "Test page");
setMetadata(assetid, "1001", "Just a simple test page");
setMetadata(assetid, "1002", "test, page");
</script>
And this is the new way of setting these values:
<script type="text/javascript">
window.api_key = 'XXXXXXXXXXXX';
// Asset ID of the asset we are updating
var assetid = "123";
var field_info = new Array();
// Update the metadata of the asset
// Metadata field 1000 = Title
// 1001 = Description
// 1002 = Keywords
var field_info = new Array();
field_info["1000"] = "Test page";
field_info["1001"] = "Just a simple test page";
field_info["1002"] = "test page";
setMetadataAllFields(assetid, field_info);
</script>
Rest assured that the setMetadata() function will continue to work as normal, so upgrading will not cause your API calls to break. But you may want to consider rewriting any parts of your code that set multiple metadata values to get a performance improvement.
Introducing workflow streams
18 JanIf you've been checking out version 3.26.0 of MySource Matrix [download] [changelog], which was released last week, you may have noticed a subtle change when you tried to create new Workflow Schema assets.
Starting from version 3.26, system administrators can create workflow schemas that contain multiple approval paths, known as Workflow Streams. Schemas will always contain a default approval stream but can then have one or more optional "alternate" streams. This allows you to create approval paths more suited to certain scenarios. For instance, you can create an "urgent" workflow stream to bypass a usual multiple-step approval path and request approval directly from a manager.

You may have noticed a similar feature is provided as part of the workflow system of our next-generation CMS product, MySource Mini.
Consistent alternative approval paths
These alternate streams can be linked under more than one workflow schema and can be moved or deleted freely. The ability to re-use alternate streams allows you to provide a consistent approval path for these scenarios, in line with business or other policies. Note that the default streams are tied to their schemas and cannot be shared or moved in this way.
Alternatively, if different workflows require different "urgent" approval paths (for instance), then alternate streams will be grouped by name. Where an asset has multiple workflow schemas applied, any selected stream name will apply for all workflows. Any workflow that does not use that stream name will use its default stream instead.
Which users can use alternate workflow streams?
The ability to use alternate streams will be restricted to those with effective Administrator permissions on the asset. For them, a second drop-down will appear next to the Status Change box (on the Details screen) when alternate streams exist, allowing a stream to be chosen when starting workflow. Other users will always use the default workflow stream and will see no changes to their interface.

Migration of workflow schemas
Migration of existing Workflow Schemas from earlier versions of MySource Matrix to the new workflow stream system in version 3.26.0 is painless as the upgrade will occur during the installation of the Workflow Stream asset. A "default" stream will be automatically created for the existing schemas in your system, and the existing approval steps will be moved underneath it.
In summary...
- Workflow streams provide the ability to specify alternative approval paths for various scenarios (such as urgent approvals).
- They can be re-used across multiple workflow schemas to create a consistent approval path for non-standard workflows across your site.
- They can only be activated by asset administrators. All other users can only use the default workflow.
- Workflow streams were released in MySource Matrix 3.26.0 on the 15th January 2010.
How usable is MySource Mini?
15 JanAccording to the book Usability Engineering, by Jakob Nielsen, usability is made up of five attributes:
- Learnability: how easy is it to learn how to use the system
- Efficiency: once you learn how to use the system, it should be quick and easy to get things done
- Memorability: for a user who doesn't use the system to often, they are able to remember how to use the system
- Errors: the number of errors that a user makes to complete a task should be low and there are no catastrophic bugs
- Satisfaction: users like using the system.
Based on these five attributes, we have asked ourselves a not so simple question:
How usable is MySource Mini?
We conduct regular usability sessions with users who are not familiar with our product, so we have a bit of past data that we can use to try and answer this question.
Is MySource Mini easy to learn?
At the start of each usability session, participants are given a very brief introduction to MySource Mini. After this they are asked to complete a minimum of 6 everyday scenarios. All participants were able to complete these scenarios with little or no help.
Once they had completed the testing, participants were asked to rate the statement "MySource Mini is difficult to learn". Nobody agreed with this statement. In fact, 50% disagreed with the statement and 50% strongly disagreed.
Based on this information, we could say that yes, MySource Mini is easy to learn.
Are users efficient when using MySource Mini?
Participants were initially hesitant and unsure of what they were doing within the system. Some users took some time to complete the first steps of the first scenario while they were familiarising themselves with the system. Once they started learning how to use the system, however, their pace increased and they completed all scenarios within 30 minutes.
Based on this, we could say that yes, users are efficient when using MySource Mini once they learn how to use the system. And we have already established that users find the system easy to learn, meaning they become efficient quickly.
Are users able to remember how to use MySource Mini?
At this stage, the memorability of MySource Mini has not really been tested. In the book, Jakob Nielsen suggests to conduct a memory test once the testing has been completed to see if participants remember how to use the system. This type of test will be added for the next round of testing - so watch this space.
Do users make errors when using MySource Mini and do catastrophic errors occur?
Considering that this was the first time that the participants were using MySource Mini, errors were to be expected. All participants made at least one mistake during each scenario. However, no participant made the same error twice and all were able to recover and go on to complete the scenario with little or no help. No catastrophic errors occurred.
From our point of view, we consider the error rate to be low. If we see that an error is re-occurring between participants, we endeavour to try and make that part of the system more usable.
Do users like the system?
From the feedback that has been received from the participants, users like MySource Mini and are very impressed by its features. Some existing MySource Matrix users are even looking forward to the day it has enough features to allow them to upgrade to MySource Mini.
So how usable is MySource Mini?
For the parts of the system that have been tested, MySource Mini has a high level of usability. Users are able to complete tasks efficiently, with very little training and only a small number of errors. At the same time, they also feel satisfied when using the system.
PHP_CodeSniffer interactive mode
14 JanPHP_CodeSniffer is traditionally run over a set of files and a report printed after the run. A developer then uses the report to fix the errors and rechecks the files manually. This can be quite time consuming for large code bases because the error list may be long or may change as other errors are fixed. To make this process easier, a new interactive mode has just been committed to the PHP_CodeSniffer SVN repository.
When PHP_CodeSniffer is asked to run interactively, it will stop checking files as soon as it finds one with errors. It will then print the error report for this file and wait for user input. The idea here is that you go away, fix the errors in the file (focusing on one file at a time) and then ask PHP_CodeSniffer to recheck the file. If the errors are now gone, PHP_CodeSniffer will continue checking the code base from where it left off. If more errors are found, the new error report is shown for the file. You also have to option of skipping the file if you would prefer to fix the errors later.
The following example shows some sample output from interactive mode. This mode is enabled using the -a command line argument.
$ phpcs -a temp.php
FILE: /Users/gsherwood/PHP_CodeSniffer/trunk/temp.php
--------------------------------------------------------------------------
FOUND 2 ERROR(S) AND 1 WARNING(S) AFFECTING 1 LINE(S)
--------------------------------------------------------------------------
2 | WARNING | Inline control structures are discouraged
2 | ERROR | Missing file doc comment
2 | ERROR | TRUE, FALSE and NULL must be lowercase; expected "true" but
| | found "TRUE"
--------------------------------------------------------------------------
<ENTER> to recheck, [s] to skip or [q] to quit :
Interactive mode also works with all other PHP_CodeSniffer command line options. So you can set the report format and standard to use, if you want to hide warnings, if you'd like to display verbose output, which files to ignore, etc.
So grab a copy of PHP_CodeSniffer from the SVN repository and give it a go. Just add -a to your normal PHP_CodeSniffer command. If you prefer to wait until the release, this feature will be in version 1.2.3 and released as stable in a few weeks time.
Everyone loves graphs at the end of the year
24 DecAnd we are no exception. So to end the year, we've got some great graphs for you to show the difference between cached and uncached page views in MySource Mini.
Thankfully, we developed an advanced AOP-style baking system for MySource Mini that we call the Channels system. This allows us to bake out all possible execution paths in the CMS at install time so we are doing much less dynamic processing while serving content. It also allows us to bake out debug calls on developer systems so we can get a good idea of what is happening when we load a page or an editing interface. Along with our XML-based DB abstraction layer (DAL) logging database queries, we get a good look at how intensive a page load is.
In the images below, each little green dot is a function within MySource Mini and each coloured line is a function call. The colours mean something special in the Channels system, but that's for another day.
This first graph is what happens when serving the home page of the sample site that comes with MySource Mini. The site was published and the page was viewed as a public user.

It's pretty big! An awful lot happens behind the scenes while a page is loading in any CMS. It is all that complexity that we try and hide from content authors and site visitors. In this uncached page, we are calling 866 functions and executing 111 database queries in 0.32 seconds. There is a bit of optimisation we are doing, but the numbers are still around the right values.
When we turn caching on, we get a completely different graph.

You can see that the complexity of the page load is now much less. Now we are only calling 131 functions and executing 12 database queries in 0.11 seconds. So it is obvious that a good caching strategy is essential to ensure your system is devoting more resources to serving pages and less to actually building those pages.
If you are keen to see what is happening, you can download the graphs in PDF format:
- Download the uncached page view graph (PDF, 127KB)
- Download the cached page view graph (PDF, 57KB)
Edit interface translation project starting for MySource Mini
17 DecThroughout MySource Mini development, we've always said that we would start a translation project for the editing interface as soon as we had the interface design complete as this would allow us to understand the true complexity of the translations. We've reached that point now and the first commits to start supporting editing interface translations have now gone in.
The gallery below shows a few screenshots of the interface translated (badly) into Korean. Most translations are simply done with Google Translate to get things started, but our lone Korean developer did help contribute where he could.
The first step in this project is to ensure all our interface messages and labels are written in a way that allows them to be translated. Like a lot of open source projects, we are using gettext for our translations, so the process of converting our strings in PHP code is pretty easy. We'll be looking into a gettext implementation for JavaScript shortly to make sure that side of the interface is supported. We also have a few images that contain text, so we will be re-building those to ensure the text is either printed using PHP or JavaScript.
The next step will be an interface where the default locale can be selected for a system and another interface where each user can choose their own preferred locale. The locales need to be supported on the server as well, so we'll also have to sort out instructions for that process.
And finally, we need translators. I know the guys in the Squiz Poland office are keen to translate the interface into Polish for us, and most of our developers know a second language to get things started. If you'd like to help, get in touch.
We expect this project to be on-going and take a while to complete, but we hope to have all the main parts of the interface available for translators early in the new year.