O'Reilly logo

Professional Alfresco: Practical Solutions for Enterprise Content Management by Kevin Roast, Michael G. Uzquiano, Michael Farman, John Newton, David Caruana

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 11. Java-Backed Web Scripts

WHAT'S IN THIS CHAPTER?

  • Understanding Java-backed Web scripts

  • Implementing a Java Folder Listing Web script

  • Creating a new kind of Web script

In this chapter, you will discover how to develop Java-backed Web scripts, which are Web scripts whose controller implementation is written in Java, rather than JavaScript. You might be wondering why you would need to dive into Java, when JavaScript Web scripts seem to cater to most requirements. Although rare, Java-backed Web scripts are useful when:

  • Accessing Alfresco Content Application Services not available via the JavaScript API

  • Interacting with systems whose only API is exposed via Java

  • Overriding how responses are rendered, such as to stream large content

  • Performance is absolutely critical

Unlike scripted Web scripts, Java-backed Web scripts require more tooling for their development. The Java source code has to be compiled, then packaged, and finally deployed to the Alfresco Content Application Server. This means deeper knowledge of the Alfresco architecture is required, such as knowing how Alfresco employs the Spring Framework for registering and binding together Java components.

Although this seems daunting, it's not that different from developing a scripted Web script, especially if you're already familiar with Java. A Java-backed Web script (as shown in Figure 11-1) has a very similar construction to that of a scripted Web script.

Figure 11.1. FIGURE 11-1

The primary difference is that a Java class replaces ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required