Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Learning Alfresco Web Scripts
  • Table Of Contents Toc
  • Feedback & Rating feedback
Learning Alfresco Web Scripts

Learning Alfresco Web Scripts

By : Ramesh Chauhan
4.5 (4)
close
close
Learning Alfresco Web Scripts

Learning Alfresco Web Scripts

4.5 (4)
By: Ramesh Chauhan

Overview of this book

If you are an Alfresco developer who has no experience with web scripts and you want to start developing Alfresco web scripts, then this book is definitely for you.
Table of Contents (12 chapters)
close
close
11
Index

Creating a Java controller


Now it's time to do some Java coding. Before we start the actual coding, it's always a good idea to quickly identify the logic that has to be taken care of by the code we are going to write. This exercise really does help a lot.

Controller logic at a high level

In order to develop a controller for this scenario, let's take a look at the implementation logic that we will include in the Java-backed controller at a high level:

  • A controller will expect nodeid as an input parameter

  • Check whether the given node is present in the repository

  • Check whether the user has at least read permissions on the given node

  • Get the filesystem location for the given node

  • Get the size on the filesystem for the given node

  • Prepare the model object and return it to the FTL response template

Let's code it!

Let's perform the following steps to create a Java-backed controller implementation for the web script that will perform all the required logic as mentioned in the previous section:

  1. Create a new...

Unlock full access

Continue reading for free

A Packt free trial gives you instant online access to our library of over 7000 practical eBooks and videos, constantly updated with the latest in tech

Create a Note

Modal Close icon
You need to login to use this feature.
notes
bookmark search playlist font-size

Change the font size

margin-width

Change margin width

day-mode

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Delete Bookmark

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete

Delete Note

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete

Edit Note

Modal Close icon
Write a note (max 255 characters)
Cancel
Update Note

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY