Permalinks

From Qubit Toolkit

Jump to: navigation, search
Design This page proposes a new feature and reviews design options
Development This page describes a feature that is currently in development
Documentation This page documents an existing feature

[edit] Introduction

A permalink is a URL that points to a specific object in the database. The purpose is to make human-readable URLs while we give permanence to links. Permalinks improve search engines optimization, as they use links and the title as part of their information gathering.

[edit] Design

[edit] Permalink format

Permalinks consist of a string of characters (called "slug") describing an object. We can establish different permalink structures. The simplest one is the object name as the only element. The desired one also includes the type of the object:

http://www.example.com/<object>/<slug>
<object>: informationobject, repository, actor...
<slug>: super-interesting-document

The slug must be unique for that object type. If it is not, it should be appended with an incremental number, e.g.:

<slug>: super-interesting-document-1
<slug>: super-interesting-document-2

Peter:

  • I would like to use the dash '-' as the separator (e.g. Wordpress style). I find it easier to read than the underscore separator.
  • Until we support some type of versioning I don't see the need to add dates as part of the permalink. Even then we may simply append the existing slug with version numbers rather than add a date suffix. This will avoid any confusion between the date of creation of the resource vs the date of creation of the archival description.

[edit] Internationalization

  • Should we support internationalization in permalinks? Support for non-latin chars in URIs?
    • It looks like only US-ASCII characters are supported in URIs - IETF RFC3986?
    • -->We should take the default language of the slugable field and convert it to a slug (i.e. using whatever language the record is first created in). However, we should strip out (and replace?) any non US-ASCII fields to comply with RFC 3986. This might be a problem if the slug value consists entirely on non US-ASCII fields but let's cross that bridge when we get there. We can always devise some rules to create arbitrary slugs if necessary.

[edit] Permalink creation

  • Should we use the sfPropelActAsSluggableBehavior plugin or create our own QubitHelper function?
    • --> I assume we want to move away from being dependent on Propel specific plugins and behaviours. We can just re-use whatever code is useful from the Propel plugin for our own function.

[edit] Permalink storage

The option to create a permalink should be made available to all objects that extend QubitObject.

Three options for storing the permalink (in order of Peter's preference):

  • as a 'permalink' column in the QubitObject table
  • as a PermalinkObject (two attributes: objectId, permalink)
  • as a 'permalink' column in each object that uses permalinks

[edit] Interesting links