Dynamic websites using WCM

A web project it not limited to just static files. Web projects can include server-side scripting files including JSP, PHP, CF, or Python files. In the end, these files would be published to the appropriate application server or web server enabled to evaluate these files. Specifically for Java, Alfresco supports the evaluation of JSPs and exploded WARs within a web project with support for preview of JSPs by the Virtual Server.

You could upload archived WARs, have Alfresco deploy them to a web application server for unpacking, and so on. For Tomcat, it could place them in the webapps directory.

Virtual server JSP support

Create a simple "hello world" JSP, load it up, and test. The JSP will evaluate without creating the WEB-INF and web.xml files. But more complex WARs will need WEB-INF and web.xml files for Tomcat to evaluate.

Previewing WARs and getRealPath()

For JSP and Java code that use the getRealPath() method or the filesystem path for a file, Alfresco requires additional configuration for the virtual server preview to function. This is the case for Spring-based web applications, where configuration and properties files are required to be read on startup.

To enable preview in this case, Alfresco needs to be modified to:

  • Enable Alfresco to use CIFS (refer Chapter 2 for details)
  • Mount the CIFS directory
  • Have the virtual server mount the AVM CIFS projection

Virtual server configuration

The virtual server needs to be configured to mount the new drive. Follow these steps:

  1. Open up the alfresco-virtserver.properties file in the directory:

    c:Alfrescovirtualtomcatconf.

  2. Locate the following section:
    #
    # On Windows, the ".unix" properties are ignored.
    # On Linux, the ".win" properties are ignored.
    #
    alfresco.virtserver.cifs.avm.versiontree.win=v
    alfresco.virtserver.cifs.avm.versiontree.unix=/media/alfresco/cifs/v
    
  3. Modify alfresco.virtserver.cifs.avm.versiontree.win=v to use the drive letter "Z" used above when mapping to the CIFS server, as follows:

    alfresco.virtserver.cifs.avm.versiontree.win=z:.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset