Macrotone Blogs

Macrotone blogs upon Joomla, our products and other matters.

Using an IDE for Joomla development

phpstormWe have never really taken to using an Integrated Development Environment tool (IDE) for product development.  This is nothing against IDE’s per se, just that over the years we have used a lot of tools, some good, some bad, and have found that just when one starts getting productive with them, they suddenly stop being supported.  We could name (but won’t) numerous tools that fall into that category.  A lot end up being taken over by a certain well known ‘computer software vendor’ who then milks them for the support fees, but never develops them, before finally dropping them. This then leave one ‘high and dry’ and forced to change to another tools.

Continue reading

Debugging PHP with Java console.

b2ap3 thumbnail joomlaIt may seem a strange title for a blog, but we have been looking at a small ‘opportunity’ in converting one of our components to Joomla 3.x.

First a brief explanation is required. The module in question is a PHP module which calls some Javascript code which in turn then calls a separate PHP routine.  The error we were trying to resolve involved this ‘second’ PHP routine.  The module was designed to display a Google map and the first PHP module sets up the display, the Javascript code builds up the required map and it is in turn, populated with data obtained from the database and formatted by the second PHP routine.

This ‘inner’ PHP routine was working perfectly on Joomla 2.5 but on Joomla 3.1 only the map itself was displayed, not the 'map points’.  It was apparent therefore that there must be ‘code’ that was not Joomla 3.x compatible but how to find it.  Code inspection did not reveal any apparent cause. The changes to remove JRequest and replace it with JInput were working fine, and attempts to use print, dump, enqueueMessage, etc. statements were accepted but would never display any information which one could see.  [This might possibly be due to our trying to display text ‘after’ the ‘error point’, but am not totally convinced yet.] Inspection of error logs also were not informative, mainly it is suspected due to the Javascript ignoring the errors and proceeding to execute even after receiving a error from the PHP routine.

Continue reading

Implementing Joomla 3.1 Tags feature

J3.1-Transparent-bgWe originally implemented the Joomla 3.1 tags feature within our Issue Tracker component. This was done using the documentation[1] by Elin Waring the originator of the feature.  This worked fine until Joomla 3.1.4 was released when it changed to use the JObserver classes.

The basic change (as we understand it) is that the tag fields were originally stored within the ‘metadata’ field where as using the (new) JObserver class removes this requirement and the tag is not required to be saved with the item at all. Both methods were intended to be supported but the implementation is broken, but may well be fixed in a later update.

We found another document[2] describing the modified configuration/setup. The problem was we couldn’t get it to work as it was described.

We eventually found a solution which is as follows.

1) In the components table class we added the following line:

JTableObserverTags::createObserver($this, array('typeAlias' => 'com_xxxxxxxxxx.yyyyyy'));

Where the component is xxxxxxxxxx and yyyyyy is the tag type.  (The differs from the suggestion in the documentation[2] which we couldn’t get working.)

2) Double check the field mappings which get placed in the #__content_types table.  The configuration document[2] shows square braces in the string but these are not required or necessary.  It is also important that the field mappings accurately match the fields within the referenced table.  A small mistype or wrong name will result in an error being generated when the tab is saved.  It doesn’t help that the error message only tells one that an error has occurred not what the actual error is.  We found out through trial and error. [We note that there are a few other fields in the #__ucm_content table that can also be populated, notably the created_by_alias.]

3) We also found that we required the following in the getItem method of the model (despite the documentation[2] saying otherwise).

$item->tags = new JHelperTags;
$item->tags->getTagIds($item->id, 'com_xxxxxxxxxx.yyyyyy');
// $item->metadata['tags'] = $item->tags;

The last line we have commented out since we do not observe any impact of it being present.

4) In one of our tag types we were using the table class method called directly, calling the various bind, check and table store methods. This meant that some code that is required to handle the tags did not get called.  The easiest way we resolved this was to instead call the parent:save  routine. This was achieved by slightly restructuring the model save method and also meant that we didn’t have to add additional code and also enabled us to simplified our code.

5) The other change we made was to the 'Hathor' template view overrides to display the tags. Again the suggestion in the documentation[2] didn't work for use and we resorted to the standard display mechanism.

Considering Metadata for our Joomla extensions

The use of Metadata within web pages to provide a ‘richer’ and more tailored data structure is not new.  The term metadata is defined as "data about data". The term is however slightly ambiguous, as it can be used for two fundamentally different concepts (types). Structural metadata is about the design and specification of data structures and is more properly called "data about the containers of data"; descriptive metadata, on the other hand, is about individual instances of application data, the data content. In our context we are really talking about ‘data about data content’.

We say it is not new because many years ago we worked upon implementing some of the ‘Dublin Core’ metadata into some specific sites that we were working with.  The focus now seems to be the use of the vocabularies as defined by ‘schema.org.  This is no doubt influenced by the fact that it was promoted by Microsoft and Google themselves.

Deciding to implement it is not for the faint hearted especially if the ‘intended’ target is composed of entities that do not easily fit into one of the defined ‘standards’.  As an example we have looked at our ‘Problem/Issue/Bug Tracking’ application.  At first glance it looks to be a ‘Product’, but the products are those that are sold, or available to hire etc.  The output from our ‘Issue Tracker’ is a set or series of ‘reports’ which describe reported problems or improvement tasks for a ‘product’ hence perhaps they should instead be an ‘Article’.  Here again they do not really fit into the current ‘standard’.  The best we can come up with would be a ‘CreativeWork’, and more specifically a ‘SoftwareApplication’, but even here we would need to add some specific custom extensions, which is possible with ‘schema.org’ to more accurately reflect information that should be in the meta tags. We require the metadata to describe the output from the application and not the application itself.

At the moment the jury is still out as to whether we wish or desire to add an automated mechanism to our application to generate the meta data automatically.  We will probably continue to monitor the situation before deciding whether to implement it as a feature or not, especially as it is not certain whether including it will improve the page rankings within Google, since the exact details of the algorithm used by Google is their secret.

Free Toad for Oracle 12.0.0.61 released

Toad World - Connected IntelligenceWe are pleased to note the release of Toad for Oracle 12c is available on the Toadworld site. This is hot after the official Oracle release itself.

We have used the tool for more years than we care to remember, and it is highly recommended. They are invaluable for good database development and support.

10 Top Time-Saving Tech Tips

Saw this video and just had to share it. It's amazing just how many things one doesn't know about even on the simple things. I bet there are is at least one thing here that you didn't know.

 

Tags:

Joomla 2.5 Language overrides

b2ap3 icon joomlaI was recently asked a question about language templates and how custom changes made by a site would be over ridden on a component update. This got me thinking and it seems that Joomla already provides a convenient way to create language overrides.  I am not talking about language overrides just specific strings being used instead of the standard supplied text.

This can all be done in the Joomla administrator.

Continue reading

Experiences with CSS and a table style

Whilst working on presenting a sample table style for our Issue Tracker component one particular colour combination was creating a few problems. The main problem was the colour of the links in the table header.  These would be used to sort the list and due to the choice of colour scheme the link colours were taking the settings from an earlier (in the tree)  DIV style.

This resulted in us temporarily shelving the table style until such time as we had to investigate further.  With the release of 1.3 of Issue Tracker we have now turned our attention back to the style sheet. The investigation was interesting and it is likely that others might benefit from our experiences hence the decision to make it a Blog post.

The resolution was to make use of the  !important declaration which been around since CSS1 but should still be used with caution.

Continue reading

Web Standards

   I am reminded of the quote “The nice thing about standards is that there are so many of them to choose from.” attributed to  “Andrew S. Tanenbaum”, whilst looking into the structure of web pages.

The Firefox browser add in ‘FireBug’ provides a nice tool under ‘Tools- Validate HTML’ which enables the page one is viewing to be checked by the W3C Markup Validation Service.   By default it uses the standard defined at the start of most web pages, but the number and variety of possible standards is most interesting.  The output is a nice listing of ‘errors' and ‘warnings’ upon the page structure and its elements. [Note that it excludes the ‘new’ standards mentioned below, although it does have ‘HTML5 Experimental’]

Whilst one can then proceed to correct and eliminate the errors and warnings it does raise the question as to what standard should one be writing web pages to:  HTML5, XHTML 1.0 Transitional, XHTHL 1.0 Standard, XHTML 1.0 Framework, HTML 4.01 Strict etc.  The list goes on to provide about 15 possible standards.

Continue reading

DocBook XML to PDF

The Apache FOP ProjectThe next stage in our documentation changes was the creation of PDF documents from the DocBook XML formats.  [See previous posts for other blogs on our documentation changes.]

There is a need to use a XSLT transform to convert the XML document to a FO (formatted object) which can then be processed to create the PDF output.

The DocBook distribution have available a set of XSL transforms for converting the XML files into a variety of different formats, so the first step was to download these. This is not strictly necessary since it is possible to access the XSL transforms over the web, but having a local copy speeds up the transformation process.

Continue reading
Go To Top

Joomla! Debug Console

Session

Profile Information

Memory Usage

Database Queries