3.
Sample Site
We will use this as a starting point: alfwf.war
• A blank Surf framework with no site construction data in it
• If you want, blow away current alfwf web app and re-deploy a
fresh alfwf.war (Or don't)‫‏‬
Sample location:
• /opt/tomcat/webapps/alfwf
• http://labs3c:8580/alfwf
12/12/08 3

4.
What should it look like?
Intended UI shown on next page
12/12/08 4

13.
Component Bindings
Home Page
Navigation
Include Include
${url.context}/html/box1.html
${url.context}/html/box3.html
Include
Include Include
${url.context}/html/box2a.html
Include ${url.context}/html/ ${url.context}/html/
box4a1.html box4b1.html
${url.context}/html/box2b.html
Include Include
Include
${url.context}/html/ ${url.context}/html/
${url.context}/html/box2c.html
box4a2.html box4b2.html
12/12/08 13

18.
2. Create Web Framework Configuration‫‏‬
Configure Surf Framework
– Point to your Green Energy site configuration file
– Add the mapping to the login and logout pages
– Declare Alfresco as your authentication source
– Add a new endpoint called http-local which is used by the
include component you expanded earlier
Contents of web-framework-config-custom.xml
appears on the next slide
The web-framework-config-custom.xml file goes in:
• /WEB-INF/classes/alfresco/web-extension
12/12/08 18

23.
4c. Initial “Smoke” Test
Start Alfresco
Start Surf Tomcat (Restart if already running)‫‏‬
Refresh the Web Script cache
– Browse to http://labs3c:8580/alfwf/service/index
– Click ‘Refresh Web Scripts’
Test your site
• http://labs3c:8580/alfwf
• Your home page should display
• You can navigate to the other two pages using /page?p=[page
name]
• The home page should display with a bunch of missing
components
• The other two pages should require a login before displaying
12/12/08 23

24.
4d. Create Page Associations
Create one Page Association object to represent each
parent-child relationship in the site page hierarchy
– Home → Products
– Home → Solutions
Make sure assoc-type is set to “child”
12/12/08 24

26.
4e. Create Component Bindings
Create one component binding for each region
If a region is scoped to a page, you have to create one
component for each region for each page
The example templates have a lot of regions. Feel free
to do a couple until you've got the idea, then let the
rest be broken
12/12/08 26

29.
Tips on creating a global footer
You will need to create a globally-scoped footer
component
• /WEB-INF/classes/alfresco/site-data/components
global.footer.xml
<?xml version='1.0' encoding='UTF-8'?>
<component>
<scope>global</scope>
<region-id>footer</region-id>
<source-id>global</source-id>
<url>/age/footer</url>
</component>
You will need to write the web script to implement
global footer
How and what you do is up to you!
12/12/08 29

30.
4f. Final Test
Refresh the Web Scripts cache
– Browse to http://labs3c:8580/alfwf/service/index
– Click on ‘Refresh Web Scripts’
Test your site
• http://labs3c:8580/alfwf
• You should be able to navigate between the three pages
• The components you configured should be showing up
12/12/08 30