I needed to rename several web content items in an Alfresco web project. Alfresco WCM does not support renaming of content. I needed a fairly painless way to rename these items without having to go through the exercise of creating them from scratch, filling in all the required fields in the web form, tagging the content, etc. This is what I came up with:

Steps:

  1. Download the content item's XML file to a local drive.
  2. Rename it on the local drive.
  3. Upload the renamed XML files via "Add content item" (or just drag and drop if you have CIFS working).
  4. Click on the pencil icon to edit the XML.
  5. Click on the link that says "To edit this file using a Web Form, click here".
  6. Select the same Web Form (i.e., authoring template) that the web content item was originally created with.
  7. Make any necessary changes to the item in form view, then click Finish. This forces re-rendering.
  8. Delete the old content XML and any files rendered under the old name.

These are some potential gotchas:

If you're in a version of Alfresco prior to 3.1, watch out for truncation of data in TinyMCE fields. This is a documented bug that only happens with Firefox. If you must use Firefox, these are the steps to avoid the truncation:

  • Before editing the content (step 4), click on the link for the XML file itself. This should show you the XML in the browser.
  • Copy the TinyMCE field text into your clipboard
  • In edit mode (step 7), click in the TinyMCE field to get focus.
  • Click on the HTML button to view the field's underlying HTML
  • Replace the old HTML with the contents of your clipboard
  • Click on "Update"

Also, make sure you have a plan for updating all content containing links that point to the old file names!