cancel
Showing results for 
Search instead for 
Did you mean: 

WCM Forms Guide on the WIKI

jconnell
Champ in-the-making
Champ in-the-making
Hey Alfresco Team,

I've been experimenting with XForms support from SVN HEAD revision (as of this morning).   I've noticed that the documentation on the wiki might be out of date.  I've started updating the wiki page at http://wiki.alfresco.com/wiki/WCM_Forms_Guide, to reflect how it currently works.  I just wanted to verify that current behavior is the intended behavior before I finish updating the page.

To give an example of one discrepency I've found, the current docs show how you can reference the Forms data in a Freemarker template.  Unfortunately, it seems that you have to use Freemarker namespaces to access the content.  I've found the following works:

Suppose your XForm produces something like the following:


<!– some namespaces excluded from example –>
<?xml version="1.0" encoding="UTF-8"?>
<cms:article xmlns:cms="http://mycms.org/cms"
   xmlns:alf="http://www.alfresco.org">
   <cms:title>Article 1</cms:title>
   <cms:date>2007-01-10</cms:date>
   <cms:location>New York, New York</cms:location>
   <cms:body>
      Here&amp;#39;s my article.&amp;nbsp; I hope it works out!
   </cms:body>
</cms:article>

To access that content using the FM rendering engine, you actually have to do the following:

<#ftl ns_prefixes={"cms":"http://mycms.org/cms"}>
<#assign article = .vars["cms:article"]>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
   <head>
      <title>${article["cms:title"]}</title>
   </head>
   <body>
      <h1>${article["cms:title"]}</h1>

      <div id="articleContent">
         <span>(${article["cms:location"]} – ${article["cms:date"]})</span>
         ${article["cms:body"]}
      </div>
   </body>
</html>

If the current behavior is correct, I'd love to update the wiki so that everybody else can start experimenting with the WCM stuff right away.

JC
2 REPLIES 2

dmusser
Champ in-the-making
Champ in-the-making
Everyone,

Along the same lines in your post about the documentation being behind a bit  I wanted to send this link to everyone.  I have posted several screen shots of Alfresco's WCM - Build 291's, create web project process.

http://unrestricted-cms.blogspot.com/

For anyone not building this themselves it should give you a good example of the direction that things are going from the preview release towards the beta.

David
dmusser@eyestreet.com

arielb
Champ in-the-making
Champ in-the-making
the part about namespaces in freemarker is correct (and unfortunate - it's one of the few parts of freemarker that i wish was more like xsl).

i kept the examples in the wiki as simple as possible to avoid getting into the complexity of explaining namespaces - but as it is an overwhelmingly frequent use case - it really should be there sooner than later.

there are likely quite a few discrepencies between the documentation and the product as a result of some evolution to the design since october when the document was written.  i'll try to make updates and corrections in the next few weeks - but do feel free to correct and add information you feel is relevant and missing.

thanks,
ariel
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.