Other OutSystems sites...
OutSystems Website
About Agility Blog
OutSystems Network
Login
Signup
Forums
Academy
Forge
Ideas
Forums
›
Guides & How-tos
›
Customized settings in web.config files per eSpace using Factory Configuration
Customized settings in web.config files per eSpace using Factory Configuration
configuration
administration
Acácio Porta Nova
Rank: #42
Posted on 2008-03-14
thumbs_up_ico
2
thumbs_down_ico
0
reply
post_link_ico
Context:
You want to define custom settings in the web.config file that vary from application to application (e.g. you want custom error handlers for HTTP error codes, that vary for each eSpace);
You are running the OutSystems Platform 4.1 for .NET;
How to do it?
You could simply change the web.config after republishing the application, but that would not be very useful because web.config is rewritten everytime you publish a new eSpace version, so you would have to manually change the web.config everytime a new version of your application is deployed.
Using Factory Configuration
The right way to do it is by using the Service Center Factory Configuration (
http://www.outsystems.com/NetworkSolutions/projectdetail.aspx?ProjectId=25
). You will need to deploy this solution, and configure the settings for it.
This application uses XSLT to make changes to the default web.config file, so you will need some insight on how to write XSLT. You will also need to check the default web.config file - you can simply navigate to the Hub Server folder and copy the web.config that is deployed by default for that eSpace.
You can also use some of the predefined templates to have an idea of how things can be done.
Creating rules
After deploying Factory Configuration, simply access
http://server/FactoryConfiguration,
login (using Service Center credentials) and navigate to Shared Configurations. Here, you can create a new shared configuration, and either use one of the templates or create a configuration from scratch. After creating your XLST rule, you simply need to navigate to eSpace and associate your configuration(s) to the eSpace(s) you wish to see associated with them. Afterwards, you need to republish the eSpaces so the changes become effective.
Example
Below there is an example that redirects all requests to non-existent aspx pages to the Service Center Login page:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" indent="yes" encoding="UTF-8"/>
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="/configuration/system.web/customErrors/error">
<xsl:copy>
<xsl:attribute name="statusCode">404</xsl:attribute>
<xsl:attribute name="redirect">/ServiceCenter/Login.aspx</xsl:attribute>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
Quick Reply
Notify me by email when someone answers to my post
attachment
Choose File
No file chosen
Submit
Login to reply
Something on your mind?
Login to Start a Discussion
RELATED DISCUSSIONS
Configuring a Microsoft ISA Server to serve Agile Platform web applications
How To: Change the OutSystems Platform Installation Path
Moving OutSystems Hub / Platform Server to a new location on your server
About config to run custom code in .Net and J2EE
Ambiguous column name 'IS_ACTIVE' in Configuration Tool
FIND MORE
Top Forums Posters
Gonçalo Martins
Ricardo Silva
Charles Colaço
João Rosado
André Vieira
Arnold Grippeling
Gerry
JD
Robert Chanphakeo
Mizé Williams
See leaderboard
Online Training
On-demand video lessons to help you learn at your own pace.
Learn More