Version 3.1.570 Released

Last night I uploaded to the site the latest upload of the HomePortals framework. Current release is 3.1.570. This release mostly contains bug fixes and some enhancements, but it also includes some interesting new features such as smart default, context object and the new 'text' content renderer.

Also this will be the last release on the 3.1 branch (unless any critical bugs appear), as I will start now working on version 3.2. So if anyone has some ideas, requests, or any other comments as to the direction of HomePortals please let me know on the comments or even better by joining the Google Groups mailing list.

Here is an overview of the new features:

Smart Defaults

Now when you create an instance of the HomePortals engine and do not provide any configuration file, HomePortals will use the current directory as the content root and resource library root. Previously HomePortals would use its own install directory as the root, resulting in some confusing behavior. This also makes it easier to create simple HomePortals-based applications without having to spend too much time on boilerplate stuff.

Another feature of the smart defaults is that whenever you indicate a path on the config file (for example for content root, resource libraries, render templates, content renderers, etc), if you start the path with anything other than a "/" character, then it will interpret that location to be relative of the current application directory. The benefit of this is that you no longer need to put the complete paths on your config resulting in your apps being more portable.

Finally when creating the XML for your pages, now most attributes are optional. You no longer need to have an "id" attribute or a "location" attribute. If you omit the location it will just use the first location it finds on your page template.

Implicit Layouts

Implicit layouts lets you use the layout region names you define on your HTML page template directly on your XML page. Before you were forced to include "layout" section on your xml page, now that's no longer the case. However you can still use the layout declaration if you want to add custom style/css class values or if you want to subdivide the layout region into subsections (for example if you want to have a dynamic number of columns).

'Text' Content Renderer

This content renderer lets you display short amounts of text on a page without requiring you to use a content resource or include another file. Yes, its as simple as it gets:

Usage example:

...
<text value="Hello world!" />
...

Context Object

This feature lets you pass a simple struct of name/value pairs that can be referenced dynamically by module attributes when rendering a page.

For example you can have on your page:

<text value="my name is {username}" />

which will then bind the token {username} to a similarly named element on the context object.

A typical use of this would be to pass URL/FORM scopes into HomePortals, since by design HomePortals is completely unaware of anything that happens outside its instance.

Actually if you use /homePortals/common/Templates/page.cfm in your app to take care of the engine instantiation and page rendering, it will already use the form/url scopes as the context object, so in the example above you could use the URL:

http://localhost/myapp/index.cfm?username=oscar

And it will render the following output:

"my name is oscar"

If you prepend the token with a $ symbol, then the property will be bound to a page property instead of an element of the context object.


Finally here are the full release notes for this update:

New feature: Added new content renderer 'text' to display small inline text or links on a page without using a content resource

NEW FEATURE: Added support for "implicit layouts". When a page does not declare a 'layout' section a default layout is created based on the page template. In this case the module's location attribute is matched against the layoutRegion name in the template to determine where to place the module

IMPROVEMENT: added support for context objects and dynamic replacement of page settings in module properties

IMPROVEMENT: Allow module location to be empty, in which case module is displayed on the first available layout region

IMPROVEMENT: Render Templates can now be used by indicating the template path even if they have not been declared on the config file

IMPROVEMENT: Upon initialization engine checks that there is a content root and library defined for the current application, if not defines content root and resource library path to the application root. This also allows to create simple apps without requiring a config file.

Improvement: when converting a page to XML format empty sections (i.e. title, layout, etc) are not included on the generated XML object

Improvement: On the 'View' tag renderer, if view location does not start with '/' then treat it as a relative location from the application's root

Improvement: any path (content, templates, res libraries, etc) that does not start with the / character is now treated as being relative to the application root. Also for paths in dot notation form, if they start with a . then they are assumed to be relative to the application root. This applies to: resource library paths, content root, base resources, plugin paths, render templates, and tag renderers.

FIXED BUG: debug template was throwing errors due to a change on how page properties are stored internally. The template was expecting a simple value, but now they are stored as structs

Fix bug: if indicating the path of content renderer beginning with a dot (.) to indicate a position relative the the app root, the engine was failing to remove the initial dot when normalizing the path. This only happens when the app root is the same as the web root.

FIX BUG: Fixed errors caused when no rss url was given and the error thrown revealed too much information about the file structure. Now only displays a message about the missing parameter.

Fix bug: fixed a bug introduced in the last update which caused an error when the href property of the 'view' content renderer was empty

Fixed Bug: a module tag without ID attribute was causing an error even though the ID attribute is supposed to be optional.

fixed bug: added missing semicolon on statement

Comments
BlogCFC was created by Raymond Camden. This blog is running version 5.9.001. Contact Blog Owner