LiveSite 2.2.1 HowTo: Generate HTML Files from the Command Line
NOTE: This tutorial is for LiveSite 2.2.1 only. This document explains how to run a command-line tool that will convert LiveSite .page files into .html files. This command-line tool can be invoked as part of a workflow or as a manual process. To convert .page files into .html files from within TeamSite, select the Generate HTML option. This document assumes the reader is familiar with DOS batch files, Java command-line execution, and TeamSite vpaths.
In LiveSite 2.2.1 this file can be found at
livesite-install-dir/livesite/instructions/howto_generate_html.txt
.
LiveSite 2.2 Steps: 1. There should be a file in the livesite directory of your LiveSite installation called
livesite_java.bat
. This is a wrapper around java.exe, which sets up the classpath and path necessary to run LiveSite command-line tools.
2. Open
livesite_java.bat
and make sure that all the path information is correct. In particular, the
IW_HOME
variable must be set to your TeamSite root.
3. Run the command
livesite_java.bat com.interwoven.livesite.tools.PageGenerator suffix username role destDir vpath [vpath vpath ...]
to convert the pages listed by vpath into html files in the given destination dir.
Arguments: suffix -- The file type you wish to convert pages into. Currenly, only
.html
,
.htm
and
.asp
are supported. (Be sure to include the dot.)
username -- User who will be performing the operation.
role -- Role of the user.
destDir -- The directory where you want the generated files to appear. This is a system path; if you want the files to appear within TeamSite, you must reference the
Y:
drive. Files will be inside of this path, in a directory structure that mirrors their workarea-relative directory structure, and with the same name but with the new suffix instead of
.page
.
vpath [vpath vpath ...] -- One or more full vpaths to the pages you wish to convert. Supplying a vpath to a directory should include all the pages in that directory, and any subdirectories, recursively.
Example: Running the command
livesite_java.bat com.interwoven.livesite.tools.PageGenerator .html jsmith master c:\temp\generatedHTML //localhost/default/main/STAGING/sites/HRIntranet
will take all the
.page
files in the HRIntranet site, and convert them into HTML in the given directory. For example, the page file
//localhost/default/main/STAGING/sites/HRIntranet/Benefits/HealthPlan.page
would produce the html file
c:\temp\generatedHTML\HRIntranet\Benefits\HealthPlan.html
LiveSite 2.2.1 Steps: 1. There should be a file in the livesite directory of your LiveSite installation called
livesite_java.bat
. This is a wrapper around java.exe, which sets up the classpath and path necessary to run LiveSite command-line tools.
2. Open
livesite_java.bat
and make sure that all the path information is correct. In particular, the
IW_HOME
variable must be set to your TeamSite root.
3. Settings for generating HTML are specified in a java properties file. A sample is supplied, called
gen_html.properties
. You should copy this file and edit its contents to specify what type of file you are generating, where you want the generated files to appear, and any parameters to pass to the components.
4. Run the command
livesite_java.bat com.interwoven.livesite.tools.PageGenerator username role propsFile vpath [vpath vpath ...]
to convert the pages listed by vpath into html files in the given destination dir.
Arguments: username -- User who will be performing the operation.
role -- Role of the user.
propsFile -- File path of the properties file that controls the settings for the generation of HTML. (See
gen_html.properties
for an example.)
vpath [vpath vpath ...] -- One or more full vpaths to the pages you wish to convert. Supplying a vpath to a directory should include all the pages in that directory, and any subdirectories, recursively.
Example: Using this properties file:
file.suffix=.html
destination.directory=c:/temp/gen_html
post.processor=com.interwoven.livesite.model.page.PostRenderingProcessor
Running this command:
livesite_java.bat com.interwoven.livesite.tools.PageGenerator jsmith master c:\temp\gen_html.properties //localhost/default/main/STAGING/sites/HRIntranet
will take all the
.page
files in the HRIntranet site, and convert them into HTML in the given directory. For example, the page file
//localhost/default/main/STAGING/sites/HRIntranet/Benefits/HealthPlan.page
would produce the html file
c:\temp\gen_html\HRIntranet\Benefits\HealthPlan.html
gen_html.properties
# Properties file for controlling the generation of HTML files.
# For more information see ./instructions/howto_generate_html.txt
#
# This is the suffix of the file type you wish to generate.
# Currently supported types: .html, .htm, .asp, .jsp.
# If you wish to generate a different type, you will need
# to create a custom processor (see the post.processor
# property, below).
file.suffix=.html
# This is the directory where you want the generated
# files to appear. This is a system path; if you want the
# files to appear within TeamSite, you must reference the Y:
# drive. Files will be inside of this path, in a directory
# structure that mirrors their workarea-relative directory
# structure, and with the same name but with the new suffix
# instead of .page.
destination.directory=c:/temp/gen_html
# This is the class which does post-processing of the generated file.
# You will need to specify this value if you implement a custom
# page suffix (other than the four listed above). If you do not
# specify this property, the default is used.
post.processor=com.interwoven.livesite.model.page.PostRenderingProcessor
# Parameters can be passed to the components by adding them
# to this properties file with "param." in front of the name.
# For example, if you have a component that expects a DCR path as
# a parameter, such as &dcrType=News/PressRelease or
# <input type="hidden" name="dcrType" value="News/PressRelease">
# you would add the following line:
# param.dcrType=News/PressRelease
#
# The prefix "param." will be stripped off of the parameter
# name before it is passed to the component. The same set
# of parameters will be passed to all components on all
# pages. You can add as many parameters as you need.
# If your parameter name has a space in it, you will need
# to escape the space with a backslash.
param.Sample\ Parameter=Foo Bar Baz
param.dcrType=News/PressRelease