Map external links to another wiki

If you are using the Import Pages to GXwiki utility and the source wiki is online, you can specify via parameters a mapping on what to do with external links pointing to a specific location.

The following parameters are mandatory:

  • ExternalLinkMapping: 0 or 1. Set 1 to enable the future
  • ExternalLinkMappingMatch: URL mapping specifying an ID and description as groups from a regular expression.
  • ExternalLinkMappingExpression: Expression to be used to substitute the previous URL keeping ID and description.

Example

Let's assume you this configuration:

ExternalLinkMapping = 1
ExternalLinkMappingExpression = ^<a href="http[s]?://wiki.[gxtechnical|genexus].*?.com/commwiki/servlet/wiki\?([0-9]+)(.*)" target="_blank">(.*)</a>$
ExternalLinkMappingMatch = [http://wiki2.genexus.com/hwikibypageid.aspx?%1|%2]

During the import process, for every external link; if you have an external URL with the following pattern

<a href="http://wiki.gxtechnical.com/commwiki/servlet/wiki?9297" target="_blank">sample link</a>

it will be mapped to the wiki syntax

[http://wiki2.genexus.com/hwikibypageid.aspx??9297|sample link]