cancel
Showing results for 
Search instead for 
Did you mean: 

Fully dynamic 'web2.0' website with Alfresco

macberger
Champ in-the-making
Champ in-the-making
I'm evaluating Alfresco for some time, and I want to create fully dynamic 'web2.0' style (kind of a blog) site with Alfresco. As I can see - the WCM is for making content from ECM available as a website in a static way.

My questions are:
1. can I create a dynamic website - where users will create content in the repository through forms, modify it, even maybe delete - all through website with - of course some AJAX and stuff.
2. Is WCM the way to go? Maybe restricted access to Alfresco SCM with REST-generated forms and pages?
3. Can WCM render content from ECM through freemarker 'on the fly'?
4. How should I implement creating content through www page? REST? Foundation Services? JSR API?

Thank in advance for all the answers
Mac Berger
4 REPLIES 4

kvc
Champ in-the-making
Champ in-the-making
Great question.

Yes, you can create a fully dynamic site … this is the reasoning behind our support for managing your site as a source tree and for providing virtualization capabilities for web applications.  A dynamic site is a web app.  WCM is designed to help you build and maintain web apps and keep your developers and contributors in sync.

In your run-time site, you can indeed embed Alfresco content services - for example, accessing our create/edit content edit for managing updates to XML.  And yes, you can have WCM use Freemarker to generate content from an Alfresco space on the fly.

In WCM, you can model content and pages (where a page is a collection of components that source 0 or more content items) via XSD.  Business users can create individual XMLs, which you may or may not pre-generate into a fixed rendition (for example, an email newsletter or PDF).  Similarly, business users can use a web form to create a definition for a new dynamic web page - the XML generated from the form specifies what components to include in the page, where they are positioned, and how they are instantiated (for example, for a directory listing, which directory contents to list). 

The key here:  the XML that defines the page *does* get statically pre-generated - as a JSP page!  Your templates (either Freemarket or XSLT) in Alfresco don't *just* pre-generate HTML - they should generated dynamic pages, which a business user can then preview and test.

Now, when a business user is using a form to add components to a page, those components are Web Scripts.  A web script is an URL-addressable Alfresco executable Javascript file whose response template is a Freemarker template.  Web scripts can really do anything:  generate lists of content from a space, query the XMLs in the current website to generate teasers and section pages - you name it.  When you generate the dynamic web page, what your template does is read the page definition XML created by the business user, and then generates the URLs to the appropriate web scripts passing as adornments the parameters specified by the business user when filling out the form.  That way, you can have a limit number of web scripts that can be combined in myriad ways on myriad web pages for a fully dynamic and *business-user composable* site.  Developers develop components; business users control everything in the site, from content to layout and presentation!

Does that answer you question?   We are very excited by this model … we think it is simple, fast, elegant, and very powerful.  We do need to provide a great deal more in the way of examples and documentation … perhaps you could help by contributing something back - a sample website project, for example - to help others here in the Community?  We'd love to give you any assistance you'd need here.


Kevin

mark_smithson
Champ in-the-making
Champ in-the-making
Hi Kevin,

We are doing something similar on a project now. We have a number of "directory pages" and are using web scripts to execute lucene queries to generate the directory listings pages based on categorisations. All the directory items are defined using WCM and Web forms.

We would be interested in producing a sample once the project is finished should you be interested.

Mark

kvc
Champ in-the-making
Champ in-the-making
Awesome!  And *yes* I would *love it*.  We are eager to get people to start posting samples of what they've done to share … and it's really important for us in terms of learning.  Looking at what you've done - and you've had to work around - really helps us hone in on what we need to do next.

I am excited about this.  Always share everything, that's what we like to say 🙂


Kevin

macberger
Champ in-the-making
Champ in-the-making
Hello Kevin

Thank you for your answer - that's what I had in mind, but I don't quite understand how to do this:

Now, when a business user is using a form to add components to a page, those components are Web Scripts. A web script is an URL-addressable Alfresco executable Javascript file whose response template is a Freemarker template. Web scripts can really do anything: generate lists of content from a space, query the XMLs in the current website to generate teasers and section pages - you name it. When you generate the dynamic web page, what your template does is read the page definition XML created by the business user, and then generates the URLs to the appropriate web scripts passing as adornments the parameters specified by the business user when filling out the form.

I mean I created some webscripts to list some of my spaces, even add my extended content to them, but now the scripts are executed directly REST-style. How can I combine them on another page as you said? For example - space listing from URL A on the top, and some other listing from URL B on the bottom. Maybe you can point me to some example code, or documentation?

BTW - I would like to post my work too (when I'm through with it Smiley Happy)

Mac