Fork me on GitHub
  1. 1.2.8 Release

    After nearly one year in the making, I am happy to announce the release of Zena 1.2.8.

    Changes related to users


    You can now mark some users as “is profile”. Once this is done, you can change all groups and auth settings for a user at once by assigning it the profile. Once this is done, you ensure that all users with a given profile have the same access rights.

    Define user as being a “profile”.

    is profile

    Set access rights through a profile.

    set profile

    Edit users through node[auth]

    Every user has an assigned node in the CMS. Until now, you could not use a single form to edit a user, including access rights and changing passwords. This can now be done through the pseudo attribute auth:

    <p do='input' name='first_name'/>
    <p do='input' name='last_name'/>
    <p do='select' label='Authorization' name='auth[profile]' type='profile' tprefix='false'/>

    There is a new user status called manager. This status is like a normal user but has the right to change user settings through the “auth” proxy (not the admin interface).

    We give the manager status to our clients so that they can create and change users but do not have access to the more complex (and error prone) admin interface.

    Changes related to queries

    Support for node scopes

    We can now search for content inside any node, not just projects or sections. Internally, Zena stores a fullpath field which contains the sequence of parental like this “1/24/35”.

    Example to search for all documents inside the current node (any depth):

    documents in sub_nodes

    This query is slower than the “project” or “section” scopes since it uses SQL “LIKE” on a text field. The index on this text field is limited to 255 characters (InnoDB limit) so it can get slow once the fullpath field exceeds this length.

    Support for home scope

    The “home” node is the root of an alias site. Since we had the “in site” scope to search anywhere inside the site’s data, we now have “in home” to only search for elements inside the site alias’ home node. This uses the “sub_nodes” scope internally.

    List all images inside the current alias site:

    documents in home

    Fulltext (sphinx) search from sqliss

    We can now use the fulltext search engine from inside sqliss. Simply use match>

    pages where fulltext match "#{params[:s]}" in site

    Search engines:

    • fulltext: searches inside the idx_text_high field (all published versioned)
    • sphinx: searches inside idx_text_high, idx_text_medium and idx_text_low with different priorities. This egine uses Spinx search (sphinx brick).

    Misc changes


    Grid now uses contenteditable by default. This should avoid some problems with cell display. There are also a number of new settings:

    • contenteditable (true). Enable html 5 contenteditable. Use ‘false’ to revert to old behavior.
    • pasteTable (true). Allow pasting multi cell content (from XLS for example).

    ajax rendering

    We now use a trick to avoid rendering an older Ajax query after a new one has been made. This is very visible when a live search is updating while the user types: the answer for “app” arrives after the result for “apple” and the end result is wrong.

    This uses a special parameter params[:zs] that increments each time an Ajax query is made and ensures query results are rendered sequentially for each dom id. The function checking for this is Zena.stampOk in zena.js. You need to update zena.js after installing the new gem:

    $ rake zena:assets
    ## exists: /home/.../public/javascripts/zena.js
       (a= overwrite all in same destination, s= overwrite none in same destination)
       overwrite (ayNs) ? y

    From the History log:

    Major changes

    • Added “update_attributes_without_clone” and “save_without_clone” to update attributes without versioning (used to sync attributes with external app). This does not change timestamps nor version or node author.
    • Added login retry wait delay on failures.
    • Added support for ‘in home’ or ‘from home’ in sqliss.
    • Added support for any scope with ‘in sub_nodes’ (uses fullpath field).
    • Added forced skin setting for sites (overwrites all but ACL skin settings).
    • Added support for profile users.
    • Added support to edit auth_user (linked user) through node’s pseudo attribute ‘auth’ (admin only) or through ‘auth_user’.
    • Created ‘manager’ user status: can edit users (only through ‘auth’).
    • Created ‘currency’ brick to fetch exchange rates.
    • Do not render an older Ajax reply if a newer one has already been received. This fixes the live query confusion.
    • Fixed loose requirements of httparty and rubyzip preventing installation.
    • Added ‘fsize’ method in view to display human readable octet size.
    • Added ‘pasteTable’ option to disable (by setting false) multi cell paste in grid.
    • Using contenteditable in grid instead of input form. Turn off with contenteditable option.
    • Fixed grid bug when leaving page while in input field.
    • Implemented ‘fulltext match’ or ‘sphinx match’ to use fulltext search in node query.
    • Added ‘group_id_to_name’ to visitor (enables group name display from node auth settings).
    • Added ‘site_readonly’ attribute to site with ‘site.readonly?’ rubyless. Useful for locking site during updates or migrations.

    Minor changes

    • Fixed gemspec to not include TextMate helper and selenium plugin.
    • Fixed xml generated file caching.
    • Added NODE_ID in ‘redir’ param on node creation (replaced by actual id).
    • Added fetch_html rubyless method to views (does an HTTP GET and returns body).
    • Fixed a bug in site alias zafu compilation (wrong home reference).
    • Fixed anchor in zazen url "":22#foo should link to anchor #foo in node ‘22’.
    • Prop eval returning nil for title properly replaces title with class name.
    • Type ctrl+return to enter a newline inside a grid.
    • Checking for defined accessors on links before passing to relation proxy (this enables custom code
      on relation modification without passing through RelationProxy).
    • Refuses to delete user node unless visitor is a manager.
    • Marks user as deleted and remove profile if node is destroyed.
    • Enable ‘parent_id’, ‘project_id’, ‘section_id’ Rubyless methods.
    • Fixed a critical bug related to changing a virtual class’ superclass.
    • Do not trigger Ajax ‘loading’ unless it takes more then 300 ms (avoid blink).
    • Fixed tlabel on [input] when there is a default label (should overwride default).
    • Fixed <p do='input'... so that the “p” tag is preserved.
    • Using shift+enter to insert carriage return in grid.
    • Improved jobs display.
    • Fixed a cache handling bug where a page could exist in the filesystem without having a cache entry
      in the database.
    • Fixed building templates on the fly with fs_skin on JS call.
    • Fixed rebuild_fullpath and added link in sites on web interface.
    • Removing bricks.yml and other initial config files from ‘rake zena:assets’.
    • Request for ‘login’ page while logged in redirects to home page instead of clearing session (fixes iPhone login issues).

    Gaspard Bucher


    1. leave a comment