[opencms-dev] link replacement during static export

Barbara Picci barbara.picci at sardi.it
Mon Sep 15 11:32:00 CEST 2003


Yes, I have already tried to do set
relativelinks_in_export=true
but nothing change: the link is always <a href="/pippo_cxm/home.html">Help</a>

I've red the comment before, I must have set the standard ruleset.
I think I've this setting on standard.

This is my opencms.properties:

# Parameters for static export
#################################################################################

# if static export is disabled nothing is exported and the rules are not used.
# For the handeling of the link tags one standard rule is generated with the
# url_prefix_http value. So you can still configure the servletpath.
staticexport.enabled=true

# the static export is controlled by the resource property export. It 
has 6 possible
# values: true, false, dynamic, https, https_enabled and dynamic_https_enabled.
# With the property staticexport.default.export you can decide whitch 
value is used if
# a resource and all parentfolders don't have the the property export set.
# If your site shoud be exported except a few resources you set the 
default to true
# and add the export=dynamic property to the folder where the dynamic 
pages are. If
# your site is mostly dynamic you set the default to dynamic and add 
the export= true
# property to the pics and the download folder.
# Only the values 'true' and 'dynamic' are allowed.
staticexport.default.export=true

# the path where to save the exported pages. This path may be 
relative or absolute.
staticexport.path=/home/httpd/html

# Prefix variables. The export prefix defines where to find the 
static reources.
# The http prefix defines the way to the dynamic resources in 
OpenCms. The https and
# the servername are used only for ssl. (If you use ssl you have to 
set the values like:
# https://server.de/${WEB_APP_NAME}/opencms for the https prefix and 
http://server.de
# for the servername)
# The String ${WEB_APP_NAME} will be replaced by the name of
# the webapplication. These variables can also be used in the rulesets.
url_prefix_export=
url_prefix_http=/${WEB_APP_NAME}/opencms
url_prefix_https=
url_prefix_servername=

# the name of the ruleset used to replace links while exporting, in 
the online project,
# in the offlineproject and for the name in the extern file system. 
There are two sets
# of rules. Depending of the staticexport.default.export parameter 
the linkrules.true or
# the linkrules.dynamic are used.
linkrules.true.export=exportrules
linkrules.true.online=exportrules
linkrules.true.offline=offlinerules
linkrules.true.extern=externrules
linkrules.dynamic.export=dynamic_exportrules
linkrules.dynamic.online=dynamic_exportrules
linkrules.dynamic.offline=dynamic_offlinerules
linkrules.dynamic.extern=dynamic_externrules

# the start rule used for extern and export (not for online and offline).
# (the rules are regular expressions in perl5 standard)
#exportfirstrule=s#.([^&\?]*)=([^&\?]*)#_$1$2#g
#
# The start rule feature is removed. Instead there is a new feature: 
While exporting
# if after the dynamic rueles nothing has changed the parameters of 
the link will be
# decoded in the name. so "/index.html?newsid=27&size=100" is 
replaced by "/index_402.html"
# where 402 is the id of the link in the database. Further rules 
(after the dynamic ones)
# will be processed with the new link.


# The rulesets for linkreplacement as comma seperated lists
# You can use the ${WEB_APP_NAME} variable for the webapplication name and the
# four prefix variables defined above (${url_prefix_export}, 
${url_prefix_http},...).
# They will be replaced befor using the regular expression.
# In addition to this it is possible to define the place where the dynamic
# generated rules should be used instead of a rule use the expression
# *dynamicRules* (including the *'s). OpenCms replaces this with the dynamic
# generated rules.
# There are two types of dynamic rules. The first one is generated with the
# resourceproperty "exportname". For each resouce with this property a rule
# will be generated that replaces the absolute path of this resource with the
# value of the property. It is principally used to get nice short foldernames
# on the disc.
# The second kind of dynamic rules are generated with the property "export".
# The possible values are explained below.
#
# Possible values for the "export" property are:
#
# export=true
#   The marked resource is exported.
#   For the online project, all links that point to this resource are
#   build according to the "linkrules.true.extern" (see above) ruleset.
#   All links found on the marked resource that have been
#   marked with the <link/> tag are followed and also checked for export.
#   Example:
#      VFS =/index.html
#      RFS =${webapp_path}/opencms/export/index.html
#      Link=<a href="${url_prefix_export}/index.html"/>
#
# export=false
#   The marked resource is not exported.
#   For the online project, all links that point to this resource are
#   build according to the "linkrules.true.online" (see above) ruleset.
#   Links on the marked resource that are marked with the <link/> tag are
#   NOT followed and therefore not exported.
#   Example:
#      VFS =/index.html
#      RFS =(none)
#      Link=<a href="${url_prefix_http}/index.html"/>
#
# export=dynamic
#   The marked resource is not exported.
#   For the online project, all links that point to this resource are
#   build according to the "linkrules.dynamic.online" (see above) ruleset.
#   All links found on the marked resource that have been
#   marked with the <link/> tag are followed and also checked for export.
#   Example:
#      VFS =/index.html
#      RFS =(none)
#      Link=<a href="${url_prefix_http}/index.html"/>
#
# Static exort and https:
#   If you intent to use https settings with the export,
#   you must extend the ${url_prefix_http} to include the http protocol,
#   and also set the ${url_prefix_https} and the ${url_prefix_servername}.
#   In this case, all links will be absolute links that contain server name
#   and protocol (but see also the resource setting "export=https_enabled"
#   explained below).
#
# export=https
#   The marked resource is not exported, but treated as a https resource.
#   For the online project, all links that point to this resource are
#   build according to the "linkrules.true.online" (see above) ruleset,
#   using the "url_prefix_https" Prefix.
#   All access to this resource that is NOT using the https protocol
#   is forbidden!
#   All links found on the marked resource that have been
#   marked with the <link/> tag are followed and also checked for export.
#   Example:
#      VFS =/index.html
#      RFS =(none)
#      Link=<a href="${url_prefix_https}/index.html"/>
#
# export=https_enabled
#   The marked resource is not exported.
#   For the online project, all links that point to this resource are
#   build according to the "linkrules.true.extern" (see above) ruleset.
#   No protocol will be used for the link, so that a browser that
#   was in https mode will be staying in https, while a http request
#   will stay in http mode.
#   Use this parameter esp. for images to prevent the dreaded 
webbrowser warning
#   that tells you something like "The page you are about
#   to view uses secure and unsecure data".
#   All links found on the marked resource that have been
#   marked with the <link/> tag are followed and also checked for export.
#   Example:
#      VFS =/index.html
#      RFS =(none)
#      Link=<a href="/${web_app_name}/${opencms_servlet_name}/index.html"/>
#
# export=dynamic_https_enabled
#   The marked resource is not exported, but treated as a https resource.
#   This is like "export=dynamic" with the addition that the resource
#   will only be delivered if the request is a https request,
#   Example:
#      VFS =/index.html
#      RFS =(none)
#      Link=<a href="${url_prefix_https}/index.html"/>
#
# The dynamic rules are only for export, online and extern rules. 
Don't use them in
# the offlineruleset.
# The parameterreplacement is done in the dynamic rules. So it works 
together with
# the exportname rule. If you have a rule befor the dynamic rules 
that is triggered
# the parameterreplacement will not happen.
ruleset.offlinerules=s#^#${url_prefix_http}#
ruleset.exportrules=*dynamicRules*, \
s#^#${url_prefix_export}#
ruleset.externrules=*dynamicRules*

ruleset.dynamic_offlinerules=s#^#${url_prefix_http}#
ruleset.dynamic_exportrules=*dynamicRules*, \
s#(.*\.gif$)#${url_prefix_export}$1#, \
s#(.*\.jpg$)#${url_prefix_export}$1#, \
s#(.*\.pdf$)#${url_prefix_export}$1#, \
s#(.*\.css$)#${url_prefix_export}$1#, \
s#(.*\.doc$)#${url_prefix_export}$1#, \
s#(.*\.exe$)#${url_prefix_export}$1#, \
s#(.*\.xls$)#${url_prefix_export}$1#, \
s#(.*\.js$)#${url_prefix_export}$1#, \
s#(.*\.zip$)#${url_prefix_export}$1#, \
s#(.*\.jpeg$)#${url_prefix_export}$1#, \
s#(.*\.txt$)#${url_prefix_export}$1#, \
s#^#${url_prefix_http}#
ruleset.dynamic_externrules=*dynamicRules*, \
s#(.*\.gif$)#$1#, \
s#(.*\.jpg$)#$1#, \
s#(.*\.pdf$)#$1#, \
s#(.*\.css$)#$1#, \
s#(.*\.doc$)#$1#, \
s#(.*\.exe$)#$1#, \
s#(.*\.xls$)#$1#, \
s#(.*\.js$)#$1#, \
s#(.*\.zip$)#$1#, \
s#(.*\.jpeg$)#$1#, \
s#(.*\.txt$)#$1#, \
s#.*##

# When set to true the links in the static export that refer to pages 
in the static export
# will be relative instead of absolute. Enable this feature only if 
you use the standard
# ruleset.
#
relativelinks_in_export=true

#


>Set the opencms.properties property
>
>relativelinks_in_export=true
>
>
>
>but read the comment before.
>
>
>
>Bye,
>
>Stephan
>
>
>
>----- Original Message -----
>From: "Barbara Picci" <barbara.picci at sardi.it>
>To: <opencms-dev at geonosis.alkacon.com>
>Sent: Friday, September 12, 2003 7:46 PM
>Subject: [opencms-dev] link replacement during static export
>
>
>>  Hi all,
>>
>>  I have a problem with the link replacement in the static export.
>>
>>  I would like that, when I export a directory (e.g. named pippo_com),
>>  this will be published in my  apache
>>  DocumentRoot.
>>  In my httpd.conf:
>>  <VirtualHost 127.0.0.1>
>>         DocumentRoot /home/httpd/html/pippo_com
>>         ServerName www.pippo.com
>>  </VirtualHost>
>>
>>  Since here all right, the directory is exported well.
>>  In the directory I have two files home.html and help.html that are in
>>  the navigation menu', but the link that is generated is:
>>
>  > <a href="/pippo_cxm/home.html">Help</a>
>>
>>  Obviously the link is wrong and I can't solve it.
>>  I'm working on it from many days and I'm frustated.
>>  I've read all the archive but I don't find the solution
>>
>>  My opencms.properties:
>>
>>  staticexport.default.export=true
>>  staticexport.path=/home/httpd/html
>>  url_prefix_export=
>>  url_prefix_http=/${WEB_APP_NAME}/opencms
>>  url_prefix_https=
>>  url_prefix_servername=
>>
>>  has anyone had the same problem?
>>
>  > bye





More information about the opencms-dev mailing list