Download - Web Quick Start: Exploring the Web Tier
![Page 1: Web Quick Start: Exploring the Web Tier](https://reader034.vdocuments.mx/reader034/viewer/2022042715/5599c7c81a28abde6e8b46c9/html5/thumbnails/1.jpg)
2
Brian Remmington
Alfresco Product Architect, WCM
![Page 2: Web Quick Start: Exploring the Web Tier](https://reader034.vdocuments.mx/reader034/viewer/2022042715/5599c7c81a28abde6e8b46c9/html5/thumbnails/2.jpg)
3
A quick demonstration
The architecture
How it’s wired together
The WQS API
How requests are handled
Creating and using a new page template
Primary goal:
• To equip you with knowledge of how the web tier of WQS works so
that you can start building your own websites based on it
What we’ll cover
![Page 3: Web Quick Start: Exploring the Web Tier](https://reader034.vdocuments.mx/reader034/viewer/2022042715/5599c7c81a28abde6e8b46c9/html5/thumbnails/3.jpg)
4
![Page 4: Web Quick Start: Exploring the Web Tier](https://reader034.vdocuments.mx/reader034/viewer/2022042715/5599c7c81a28abde6e8b46c9/html5/thumbnails/4.jpg)
5
Transfer Service
WQS API WQS API
![Page 5: Web Quick Start: Exploring the Web Tier](https://reader034.vdocuments.mx/reader034/viewer/2022042715/5599c7c81a28abde6e8b46c9/html5/thumbnails/5.jpg)
6
web.xml
web-application-config.xml
wcmqs-webapp-context.xml
surf-config.xml
Creates Spring
dispatcher servlet
Loads up surf-config and
wcmqs-webapp-context
Bootstraps Surf itself and
defines new default request
handler and interceptors
Other request handlers, view
resolvers, Freemarker
directives, and interceptors
![Page 6: Web Quick Start: Exploring the Web Tier](https://reader034.vdocuments.mx/reader034/viewer/2022042715/5599c7c81a28abde6e8b46c9/html5/thumbnails/6.jpg)
7
• API wired with “wcmqs-api-context.xml”
• Auto-bootstrapped when dropped into a Surf application
• Properties that can be adjusted (with their defaults):
• wcmqs.api.alfresco=http://localhost:8080/alfresco
• wcmqs.api.user=admin
• wcmqs.api.password=admin
• wcmqs.api.alfresco.cmis=%{wcmqs.api.alfresco}/service/cmis
• wcmqs.api.alfresco.webscript=%{wcmqs.api.alfresco}/service/api/
• Override in a file named “wqsapi-custom.properties” in the
“alfresco/extension” folder on the classpath
![Page 7: Web Quick Start: Exploring the Web Tier](https://reader034.vdocuments.mx/reader034/viewer/2022042715/5599c7c81a28abde6e8b46c9/html5/thumbnails/7.jpg)
8
• Bean “webSiteService” is
a good starting point:
![Page 8: Web Quick Start: Exploring the Web Tier](https://reader034.vdocuments.mx/reader034/viewer/2022042715/5599c7c81a28abde6e8b46c9/html5/thumbnails/8.jpg)
9
![Page 9: Web Quick Start: Exploring the Web Tier](https://reader034.vdocuments.mx/reader034/viewer/2022042715/5599c7c81a28abde6e8b46c9/html5/thumbnails/9.jpg)
10
• Executes before the default controller is reached
• Uses the requested URL to find the website, section, and
asset that are being addressed
www.example.com/news/global/financial_outlook_good
• Stores the API objects on the request context with the
names “website”, “section”, and “asset”.
website
section
asset
![Page 10: Web Quick Start: Exploring the Web Tier](https://reader034.vdocuments.mx/reader034/viewer/2022042715/5599c7c81a28abde6e8b46c9/html5/thumbnails/10.jpg)
11
• Wired in to respond
whenever an asset has
been resolved
• Discovers the page name
to be used to render the
asset
• Each section may define
template mappings from
asset type to view name
• Searches up the type
hierarchy first, then the
section hierarchy
![Page 11: Web Quick Start: Exploring the Web Tier](https://reader034.vdocuments.mx/reader034/viewer/2022042715/5599c7c81a28abde6e8b46c9/html5/thumbnails/11.jpg)
12
• org.alfresco.wcm.client.controller.StreamedAssetController
• Provides support for simple-to-generate, permanent URLs
for assets:http://localhost:8081/wcmqs/asset/de2f9b66-6bbd-4347-8f24-4ed06299ad8a
• Slightly faster to generate
• Remains the same when the asset is renamed or moved
• Supports renditions:…/asset/de2f9b66-6bbd-4347-8f24-4ed06299ad8a?rendition=mediumNewsThumbnail
• Still looks for the appropriate template
• Is mapped to the path “/asset/**” (in wcmqs-webapp-
context.xml)
![Page 12: Web Quick Start: Exploring the Web Tier](https://reader034.vdocuments.mx/reader034/viewer/2022042715/5599c7c81a28abde6e8b46c9/html5/thumbnails/12.jpg)
13
• org.alfresco.wcm.client.controller.SearchFormController
• An example of a Spring
Annotation Handler
Search RSS
• org.alfresco.wcm.client.controller.RssController
• Another annotated handler
• Mapped to “**/rss.xml”
![Page 13: Web Quick Start: Exploring the Web Tier](https://reader034.vdocuments.mx/reader034/viewer/2022042715/5599c7c81a28abde6e8b46c9/html5/thumbnails/13.jpg)
14
![Page 14: Web Quick Start: Exploring the Web Tier](https://reader034.vdocuments.mx/reader034/viewer/2022042715/5599c7c81a28abde6e8b46c9/html5/thumbnails/14.jpg)
15
![Page 15: Web Quick Start: Exploring the Web Tier](https://reader034.vdocuments.mx/reader034/viewer/2022042715/5599c7c81a28abde6e8b46c9/html5/thumbnails/15.jpg)
16
![Page 16: Web Quick Start: Exploring the Web Tier](https://reader034.vdocuments.mx/reader034/viewer/2022042715/5599c7c81a28abde6e8b46c9/html5/thumbnails/16.jpg)
17
![Page 17: Web Quick Start: Exploring the Web Tier](https://reader034.vdocuments.mx/reader034/viewer/2022042715/5599c7c81a28abde6e8b46c9/html5/thumbnails/17.jpg)
18
five-block.ftl
![Page 18: Web Quick Start: Exploring the Web Tier](https://reader034.vdocuments.mx/reader034/viewer/2022042715/5599c7c81a28abde6e8b46c9/html5/thumbnails/18.jpg)
19
bellyband
left1right1
bottom-left bottom-right
![Page 19: Web Quick Start: Exploring the Web Tier](https://reader034.vdocuments.mx/reader034/viewer/2022042715/5599c7c81a28abde6e8b46c9/html5/thumbnails/19.jpg)
20
![Page 20: Web Quick Start: Exploring the Web Tier](https://reader034.vdocuments.mx/reader034/viewer/2022042715/5599c7c81a28abde6e8b46c9/html5/thumbnails/20.jpg)
21
![Page 21: Web Quick Start: Exploring the Web Tier](https://reader034.vdocuments.mx/reader034/viewer/2022042715/5599c7c81a28abde6e8b46c9/html5/thumbnails/21.jpg)
22
bottom-left bottom-right
webscripts/list/wide.get.js
webscripts/list/wide.get.html.ftl
![Page 22: Web Quick Start: Exploring the Web Tier](https://reader034.vdocuments.mx/reader034/viewer/2022042715/5599c7c81a28abde6e8b46c9/html5/thumbnails/22.jpg)
23
left1
![Page 23: Web Quick Start: Exploring the Web Tier](https://reader034.vdocuments.mx/reader034/viewer/2022042715/5599c7c81a28abde6e8b46c9/html5/thumbnails/23.jpg)
24
wiki.alfresco.com
forums.alfresco.com
twitter: @AlfrescoECM