Tutorials

Task-driven tutorials and recipes for PageSeeder

How to create a website (or Berlioz) publish script in PageSeeder (Advanced)

Skills requiredXML
Time required (minutes)30
Intended audienceDeveloper
DifficultyEasy
CategoryDocument

Objective

This tutorial shows how to use advanced features in publish scripts at the folder level. These more sophisticated features are typically used for advanced website publishing.

Pre-requisites

Note

Please make sure you have the following items setup before proceeding:

PageSeeder (version 5.7 or above) installed, see Installation guide for setting up PageSeeder;

Jetty and Berlioz website installed;

FTP server in target website server;

Exposure to XML language;

Experience in programming Apache ANT script. See manual  for more information.

Tutorial

Create PageSeeder webapp config

Create a publish configuration file: 

/pageseeder/webapp/WEB-INF/template/[project]/Publish/publish-config.xml

with the following content:

<?xml version="1.0"?>
<publishing>
  <action type="publish">
    <source type="folder"/>
    <target name="ps-publish-website-folder">
      <description>Publish folder to website</description>
    </target>
  </action>
</publishing>

Publish parameters

Following are examples of parameters available on the publish. For a complete reference of the <publishing> element, see Document Publishing.

  • Sample for date pick option
<target name="ps-publish-website-folder">
<param label="File last modified date sinc"
        name="file-date"
        type="date"
     pattern="yy-mm-dd"/>
  • Sample for selective option

<param label="Document status"
           name="document-status"
           type="select"
        default="Approved" >
   <value>None</value>
   <value>Initiated</value>
   <value>In Progress</value>
   <value>Approved</value>
   <value>Complete</value>
   <value>Published</value>
</param>

Define Publish FTP property file

Create a website properties: 

/pageseeder/webapp/WEB-INF/[project]/Publish/config/website.properties

with the following content:

# --------------------------------------------------------------------------- #
# BERLIOZ PROPERTIES FOR A WEBSITE (Server)                                   #
# --------------------------------------------------------------------------- #
# This file will be copied to the /config directory of your project on the    #
# publisher when your deploy this publish script to the server using FTP      #
# (build.xml > deploy-server).                                                #
#                                                                             #
# This file will ultimately be used by the Publisher on your PageSeeder       #
# production server when you publish your group/document to the Website. It   #
# should therefore specify the properties of your production Berlioz Website. #
# --------------------------------------------------------------------------- #

# FTP properties
ftp.server=[Host URL]
ftp.userid=[Host User ID]
ftp.password=[Host User Password]
ftp.dir=webapps[Host Remote Folder]

Publish the content of a folder

This folder publish will export all content including documents, images and binary files. It then copies the files to a server via FTP.

On the target server, the corresponding folder is deleted and the new content is written on top of it.

Get the basic publishing script (refer to How to create a website (or Berlioz) publish script in PageSeeder).

To modify the ps:export options, see the reference page for the Export task. Some examples are as follows:

  • Export using document status
<filter with="psstatus:${ps.param.document-status}" />
  • Export using the document last modified date
<filter since="${ps.param.file-date}"/>
  • Export PDF files since the date selected in publishing option
<filter with="psmediatype:application/pdf"
       since="${ps.param.file-date}"/>

Check the configuration

To check if the Publish option is properly enabled at the folder level. Go to the Document -> Browse.

Clipboard03.jpg

Created on , last edited on