售 价:¥
温馨提示:数字商品不支持退换货,不提供源文件,不支持导出打印
为你推荐
Learning Alfresco Web Scripts
Table of Contents
Learning Alfresco Web Scripts
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers, and more
Why subscribe?
Free access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. Getting Familiar with Web Scripts
Understanding web scripts
Reasons to use web scripts
Understanding when to use a web script
Understanding where web scripts can be used
Understanding how web scripts work
MVC in web scripts
Making web scripts work
Types of web scripts
Data web script
Presentation web script
Summary
2. It's Time for the First Web Script
Creating your first web script in Alfresco
Understanding the web script URI
Adding arguments to a web script
Extending the first web script to use the controller
Behind the scenes of web script execution
A web script without a controller
A web script with a controller
Important things for any web script
HTTP methods supported by a web script
Web script arguments
Explicit arguments
Implicit arguments
Understanding which one to choose
Response formats for a web script
Response formats supported by the web script framework
Specifying the response format
Specifying the response format via URL – extension on web script ID
Specifying the response format via URL – explicit format argument
The default format
Summary
3. Understanding the Web Script Framework
Execution flow of web scripts
Overall flow for a web script
Behind the scenes implementation
Components of the web script framework
Web Script Runtime
Servlet Runtime
Portlet Runtime
JSF Runtime
Facebook Runtime
SURF Runtime
Web Script Authenticator
HTTP basic authenticator
Alfresco explorer authenticator
JSR-168 Authenticator
JSR-168 Authenticator with Alfresco Explorer support
Facebook Authenticator
Web Script Container
Repository Container
Presentation Container
Other supporting components
Configuration service
Web Script registry
Format registry
Script processor registry
Template processor registry
Search path
Understanding the wiring of web script framework components
Deployment architecture
Summary
4. Building Blocks of Web Scripts
The description document – it's a must!
Mandatory declarations
The <webscript> tag
The <shortname> tag
The <url> tag
Optional declarations
<format>
argument
extension
any
<authentication>
none
guest
user
admin
<transaction>
none
required
requiresnew
<family>
<cache>
never
public
mustrevalidate
<negotiate>
<lifecycle>
none
sample
draft
public_api
draft_public_api
deprecated
internal
<formdata>
<args>
<requests>
<responses>
kind
Controller implementation – not mandatory!
The JavaScript-backed controller
Understanding when to use the JavaScript controller
The Java-backed controller
Understanding when to use a Java-backed controller
Response templates – yes, they are required!
I18N for a web script – it's optional
Adding a resource bundle for the hello world web script
Modifying the response template to use labels
Configuration document – it's optional
Accessing configuration in a controller
Accessing configuration in a template
Naming conventions – the most important thing
Summary
5. Invoking Web Scripts
Invoking a web script from a web browser
Executing a web script using web browser plugins
Poster – Firefox add-on
Advanced REST client for Chrome
Executing a web script from standalone Java program
HttpClient
Understanding how to invoke a web script using HttpClient
URLConnection
Apache HTTP components
RestTemplate
Calling web scripts from Spring-based services
Invoking a web script from Alfresco Share
Calling a web script from the presentation web script JavaScript controller
Invoking a web script from client-side JavaScript
Calling a web script from the command line
Calling a web script from JSR-168 portals and the JSF page
Calling a web script from JSR-168 portals
Calling a web script from the JSF page
Dealing with client limitations
Summary
6. Creating Java-backed Web Scripts
Use case scenario
Web script functionality at a high level
Getting ready
Creating a description document
Creating a response template
Creating a Java controller
Controller logic at a high level
Let's code it!
Configuring the controller for the web script
Deploying the web script
Registering the web script
Testing the web script
Test case 1 – mandatory check
Test case 2 – invalid argument value
Test case 3 – invalid access
Test case 4 – test with valid data
DeclarativeWebScript versus AbstractWebScript
Using controllers smartly
Summary
7. Understanding JavaScript-based Web Scripts in Detail
Understanding what you can do with the JavaScript API
JavaScript APIs in Alfresco
Identifying JavaScript APIs
Root objects to access JavaScript APIs
Other available root objects
A must-know ScriptNode API
Code examples
Creating a folder
Retrieving explicit arguments
Folder creation under company home
Finding a node
Checking user permissions on a node
Getting the path of a node
Checking the properties of a node
Logging the property value
Modifying property of a node
Getting the current username and e-mail
Returning the guest home node
Creating your own root object
Custom JavaScript extension
Summary
8. Deployment, Debugging, and Troubleshooting Web Scripts
Deployment options
The repository option
The filesystem option
Understanding deployment locations
Choosing the deployment option
Debugging web scripts
Enable logging
Remote debugging on the server
Other debugging techniques
Troubleshooting pointers
A valid SecureContext error
Web Script format '' is not registered
Cannot locate template processor for template
Script URL does not support the method
Web scripts on a production server
Running web scripts in the background
Logging web script logs separately
Disabling Java-backed web scripts
Summary
9. Mavenizing Web Scripts
Setting up your environment
Exploring the Alfresco Maven repository
Creating the default project structure for AMP
Generating AMP from the default project
Setting up a development environment with Eclipse
Understanding the default project structure
Extending your default project to create web scripts
Applying AMP to the Alfresco WAR for testing
Summary
10. Extending the Web Script Framework
Custom implementation of the web script runtime
The custom implementation of a web script container
Custom authenticator implementation
Custom script processor implementation
Custom template processor implementation
Customizing formats
Summary
Index
买过这本书的人还买过
读了这本书的人还在读
同类图书排行榜