tailieunhanh - Quản lý cấu hình web - part 35
Tham khảo tài liệu 'quản lý cấu hình web - part 35', công nghệ thông tin, đồ họa - thiết kế - flash phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | Integrating WCM Using Web Scripts Objectives of a controller This is an optional component of a web script but generally used when you want to access the repository and perform certain operations. Similar to the role of a controller in the MVC architecture here also the main objective of the controller is to dictate what to do behind the scenes and what to display in the view. The controller builds a data model that is passed to the FreeMarker response templates and rendered. Web scripts in Alfresco support two types of controllers JavaScript controller Java-backed controller In the following sections we will talk about these both in detail. JavaScript controller A controller is used in order to perform some business logic and one of the available controllers is JavaScript which is also known as execution script. You need to follow the naming convention for a web script execution script which is serviceId . httpMethod .js where serviceId is the web script ID and httpMethod can be get post put or DELETE. For example if we have a web script that is responsible for getting the news we can have the filename as . Root objects for an execution script Alfresco provides a set of default root objects also known as Script Node objects that wrap the common Alfresco repository concepts such as nodes aspects associations and properties. The list of these root objects which you can use for an execution script is as follows companyhome The company home template node. This is available only if authenticated. userhome Current user s home space template node. This is available only if authenticated. person Current user s person object template node. This is available only if authenticated. args An associative array of any URL parameters. ---------------------------------- 322 --------------------------------- Download from Wow eBook Chapter 10 search The host object providing access to Lucene Search. people The host object providing access to .
đang nạp các trang xem trước