The official documentation is at: http://docs.alfresco.com
Table of Contents
This document provides a quick tutorial on how to register and use WCM Forms. For a more in-depth tutorial, download the latest WCM Product Evaluation Guide from [sourceforge]. For more general background information on forms (along with the definitions of various useful terms), see the WCM Forms Developer Guide.
Typically, the Alfresco webapp runs within an application server (e.g.: Tomcat) that is bound to port 8080. Thus, suppose you direct your browser to:
The Alfresco webapp will redirect you to the main login page:
For the sake of brevity, let's assume this machine is localhost. Therefore, assuming no cookies have been set so far, you'd see the main Alfresco login page at:
By default, if you don't already have a username and password already set up, you can use the username admin and use the password admin. Typically, you'd want to create separate usernames and passwords for each user of the system. If your browser already have a non-expired login cookie for Alfresco, you won't even need to login.
Navigating to 'Company Home'
In the upper left corner of the browser, you'll see the words 'Company Home' near the Alfresco logo. Click on this label.
Navigating to 'Web Projects'
You should now see a set of 'spaces' that include:
- Data Dictionary
- Guest Home
- User Homes
- Web Projects
Each 'space' has an icon next to it that looks like a folder. Click on the 'Web Projects' folder.
Creating a web project if you don't already have one
If you don't have any web projects listed, then you'll have to create a new one now. You can do this by clicking on the Create dropdown menu, and then selecting Create Web Project item (be careful to click on the label itself, not the globe icon associated with the label).
At this point you should be in the 'Create Web Project Wizard'. Provide a name for your web project (it's best to use a name that includes only the letters a-z, numbers and the '-' character. For example 'mysite'.
Give the web project a title and a brief description, then click the 'Next' button.
Now invite a user into our web project. You can see who the users are by clicking the 'Search' button. For now, let's just invite a single user named 'Guest'. Click on 'Guest' then immediately below that, click on 'Content Contributor'. Once you click the 'Add to List' button, the user 'Guest' has been added.
Click the 'Next' button.
You should now see the Create Web Project Wizard form that allows you to send your user email. Feel free to skip over this by clicking the 'Next' button again.
Now you should be on the final step of the Create Web Project Wizard. Once you click the 'Finish' button, your web project has been created. However, a brand-new web project will not contain any content, so next we'll upload a sample website. To do this, first click on your web project's name (e.g.: 'mysite'). Then click on 'Browse Website' for your sandbox.
Within your new web project sandbox, you should see a menu item that says 'Create'. Click on it and select 'Bulk Import'.
Now click on the 'Browse' button to upload a zip/war file containing a sample website. For example, double-click on the file: alfresco-sample-website.war. Click on the 'Upload' button, then the 'OK' button. At this point, you should see a breather-bar indicating that an import is taking place. It may take a few seconds to complete.
If your virtualization server is currently running, turn it off now. If your virtualization server had created a 'work' directory, delete that now also. Once this has been done, start your virtualization server. This is known as a 'clean restart'. Check the virtualization server console/logs for any startup errors.
Note: If you see an error such as 'java.lang.ClassNotFoundException: org.apache.catalina.ssi.SSIFilter' then check your installation under './virtual-tomcat/server/lib/'. You should rename the file 'servlets-ssi.renametojar' to 'servlets-ssi.jar'.
Check that this is working OK, by clicking on 'Preview Website'.
Registering a web form
Go to the 'Company Home' directory by clicking on the 'Company Home' label in the upper left corner of your browser (near the Alfresco logo).
Navigate to the 'Web Projects' area by clicking on the 'Web Projects' folder.
There should be at least one web project here (e.g.: mysite). If not, return to the instructions above entitled 'Creating a web project if you don't already have one'.
Click on the web project and then click on the 'Actions' dropdown menu item. Within the submenu that appears, click on 'Edit Web Project Settings'. Step through the 'Edit Web Project Wizard' to the step for selecting/creating Web Forms. Click on 'Create Web Form'.
The first field within the 'Create Form Wizard' asks you to select a 'Schema'. A schema is a specification of the XML data structure that your form will be collecting. Click on the 'Browse' button, and double click on press-release.xsd. You can fill in the 'Description' field however you'd like. Once you've done this, click the 'Next' button.
Now select the appropriate 'Rendering Engine Template File'. In this example, click the 'Browse' button and navigate to 'press-release.xsl'. Double-click on 'press-release.xsl' to select it. The system will recognize this as an XSL file automatically because its extension is .xsl.
Next, set the file extension for generated assets by entering html in the subsequent text field.
Click the 'Add to List' button, then the 'Next' button, then the 'Finish' button.
You have now successfully registered a web form.
Using web forms
As stated earlier, you can navigate to a particular web project by clicking on the 'Company Home' label near the Alfresco icon in the upper left of your browser's display area. Once within the 'Company Home' folder, you can navigate to the listing of websites by clicking on the folder icon near the word 'Web Projects'.
Choose a website in which you want to add content via web forms. For example, if you have a website named mysite, click on it.
Within your website (e.g.: mysite), you should see a set of sandboxes. For example:
- Staging Sandbox
- User Sandboxes
- My Sandbox
- My Sandbox
Click on the My Sandbox icon (it looks like a blue globe within a brown box).
Now we're going to navigate into one of the webapps within this website. If you've already uploaded the alfresco-sample-website.war website, you'll have a webapp named ROOT. Within that webapp, you'll see a folder called media. Click on it. Next you'll see a folder called releases. Click on it. Now you're in the folder this example is expecting when generating output.
Click on the 'Create' menu, and within the dropdown that appears, select 'Create Web Content'. You should now be within the 'Create Web Content Wizard'.
Click on the 'Name' field and provide a name for file you'd like to generate. Because we're capturing XML data, let's name the file press-release.xml. Select the XML content type, and the press-release form. Then, click the 'Next' button. Fill out the form.