N2CMS的web.config配置

本文介绍N2CMS的内容管理系统配置细节,包括web.config文件的基本设置、IIS6/IIS7配置、N2元素定义、连接字符串配置及认证设置等。


N2CMS的web.config配置

The web.config you get with the various N2 downloads should point you in the right direction and just work out of the box - the main part to change is the database connection string. Below gives details on all the web.config settings N2 adds and needs.

The basics

N2 needs the N2 element described below, the connection string and IIS6/7 settings described below. You also need to configure the N2 section:

<sectionGroup name="n2" type="N2.Configuration.SectionGroup, N2">
        <section name="host" type="N2.Configuration.HostSection, N2" requirePermission="false"/>
        <section name="engine" type="N2.Configuration.EngineSection, N2" requirePermission="false"/>
        <section name="database" type="N2.Configuration.DatabaseSection, N2" requirePermission="false"/>
        <section name="edit" type="N2.Configuration.EditSection, N2" requirePermission="false"/>
</sectionGroup>

And add some expression builder settings:

<compilation debug="true">
        <expressionBuilders>
                <add expressionPrefix="CurrentItem" type="N2.Web.Compilation.CurrentItemExpressionBuilder, N2"/>
                <add expressionPrefix="CurrentPage" type="N2.Web.Compilation.CurrentPageExpressionBuilder, N2"/>
                <add expressionPrefix="Code" type="N2.Web.Compilation.CodeExpressionBuilder, N2"/>
                <add expressionPrefix="StartPage" type="N2.Web.Compilation.StartPageExpressionBuilder, N2"/>
                <add expressionPrefix="HasValue" type="N2.Web.Compilation.HasValueExpressionBuilder, N2"/>
        </expressionBuilders>
</compilation>

You will need to configure all pages so they don't get postback validation and have N2 controls registered without needing to use the @Register syntax:

<pages validateRequest="false" enableEventValidation="false">
        <controls>
                <add tagPrefix="n2" assembly="N2" namespace="N2.Web.UI.WebControls"/>
                <add tagPrefix="n2" namespace="N2.Templates.Web.UI.WebControls" assembly="N2.Templates"/>
        </controls>
</pages>

And also some sitemap support:

<siteMap defaultProvider="PublicSiteMap">
        <providers>
                <add name="PublicSiteMap" type="N2.Web.PublicSiteMapProvider, N2" startPageIsRoot="true"/>
        </providers>
</siteMap>

Once these are present, you will then need to add/configure the IIS6/IIS7 elements, the N2 element, the connection string and authentication.

II6 settings

If you are running on IIS6, you will need the following section inside your system.web element:

<httpModules>
        <add name="n2.initializer" type="N2.Web.InitializerModule,N2"/>
</httpModules>
<httpHandlers>
        <add path="*.n2.ashx" verb="*" type="N2.Web.AjaxRequestHandler, N2"/>
</httpHandlers>

IIS7 settings

Under IIS7 the above can be skipped, and the following should be added under the system.webServer element:

<modules runAllManagedModulesForAllRequests="true">
        <add name="n2.initializer" type="N2.Web.InitializerModule, N2"/>
</modules>
<handlers>
        <add name="n2.ajax" path="*.n2.ashx" verb="*" type="N2.Web.AjaxRequestHandler, N2"/>
</handlers>

N2 Settings

The N2 element holds most of the configuration information N2 needs to run. You will need to define it first in your configSection element, as mentioned above (and repeated here again):

<sectionGroup name="n2" type="N2.Configuration.SectionGroup, N2">
        <section name="host" type="N2.Configuration.HostSection, N2" requirePermission="false"/>
        <section name="engine" type="N2.Configuration.EngineSection, N2" requirePermission="false"/>
        <section name="database" type="N2.Configuration.DatabaseSection, N2" requirePermission="false"/>
        <section name="edit" type="N2.Configuration.EditSection, N2" requirePermission="false"/>
</sectionGroup>
<n2>
        <!-- If you install a database from scrach you'll need to insert some required pages.
        This can be done by the web based installer located at http://yoursite/install/edit -->
        <host rootID="1" startPageID="1">
                <web extension=".aspx" isWeb="true" 
                        rewrite="RewriteRequest" observedExtensions="" 
                        observeEmptyExtension="false" 
                        ignoreExistingFiles="false">
                        
                        <urls enableCaching="true"/>
                </web>
        </host>
        <engine/>
        <!-- Other flavours: SqlServer2005, SqlServer2000, MySql, SqLite -->
        <database connectionStringName="N2CMS" flavour="MySql"/>
        <edit>
                <installer checkInstallationStatus="false"/>
        </edit>
</n2>

Connection strings

The web.config in the binary release contains a few examples of connection strings to common databases. If you already have a connection string whose name you don't want to change you will have to change "connection string name property" in the castle configuration section (nhSettings below). Dont forget to create a database and configure the connection string.

<connectionStrings>
                <!-- Some connection string examples
                SQLite:                         <add name="N2CMS" connectionString="Data Source=|DataDirectory|\n2.db;Version=3;New=True;" providerName="System.Data.SQLite"/>
                SQL Server 2005:        <add name="N2CMS" connectionString="Server=(local);Database=N2_Templates;Integrated Security=SSPI"/>
                SQL Express 2005:       <add name="N2CMS" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\N2.mdf;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient"/>
                SQL Server 2000:        <add name="N2CMS" connectionString="Data Source=SQLServer2000;Database=SQLDatabase2000;User Id=SqlUser2000;Password=SqlPassword2000;Network Library=DBMSSOCN;" providerName="System.Data.SqlClient"/>
                MySQL:                          <add name="N2CMS" connectionString="Data Source=MySQLServer;Database=MySQLDatabase;User Id=MySQLUser;Password=MySQLPassword;" providerName="MySql.Data.MySqlClient"/>
                -->
                <!-- Please not that you need to configure another database and remove \bin\system.data.sqlite.dll if you run in medium trust -->
                <add name="N2CMS" connectionString="Data Source=|DataDirectory|\n2.sqlite.db;Version=3;New=True;" providerName="System.Data.SQLite" />
                <!--<add name="N2CMS" connectionString="Data Source=.\SQLEXPRESS;Database=N2;Integrated Security=SSPI" providerName="System.Data.SqlClient"/>-->
</connectionStrings>

Authentication

The super-user/root/admin password is configured in the authentication element in System.Web:

<system.web>
        <authentication mode="Forms">
                <forms loginUrl="edit/login.aspx" protection="All" timeout="30000" path="/">
                        <credentials passwordFormat="Clear">
                                <!-- WARNING: Change this default password -->
                                <user name="admin" password="docs"/>
                        </credentials>
                </forms>
        </authentication>
</system.web>

Users (N2 uses the ASP.NET 2.0 Membership provider system for its users) are configured in the Membership element in System.Web:

<system.web>
        <!-- These membership and role providers store their data as content items. 
        You can also use the forms authentication credentials only (remove these sections) 
        or the default ASP.NET providers (check your ASP.NET documentation) -->
        <membership defaultProvider="ContentMembershipProvider">
                <providers>
                        <clear/>
                        <add name="ContentMembershipProvider" type="N2.Security.ContentMembershipProvider, N2.Security"/>
                </providers>
        </membership>
        <roleManager enabled="true" defaultProvider="ContentRoleProvider">
                <providers>
                        <clear/>
                        <add name="ContentRoleProvider" type="N2.Security.ContentRoleProvider, N2.Security"/>
                </providers>
        </roleManager>
</system.web>

来源:http://code.google.com/p/n2cms/wiki/WebConfig

内容概要:本文围绕六自由度机械臂的人工神经网络(ANN)设计展开,重点研究了正向与逆向运动学求解、正向动力学控制以及基于拉格朗日-欧拉法推导逆向动力学方程,并通过Matlab代码实现相关算法。文章结合理论推导与仿真实践,利用人工神经网络对复杂的非线性关系进行建模与逼近,提升机械臂运动控制的精度与效率。同时涵盖了路径规划中的RRT算法与B样条优化方法,形成从运动学到动力学再到轨迹优化的完整技术链条。; 适合人群:具备一定机器人学、自动控制理论基础,熟悉Matlab编程,从事智能控制、机器人控制、运动学六自由度机械臂ANN人工神经网络设计:正向逆向运动学求解、正向动力学控制、拉格朗日-欧拉法推导逆向动力学方程(Matlab代码实现)建模等相关方向的研究生、科研人员及工程技术人员。; 使用场景及目标:①掌握机械臂正/逆运动学的数学建模与ANN求解方法;②理解拉格朗日-欧拉法在动力学建模中的应用;③实现基于神经网络的动力学补偿与高精度轨迹跟踪控制;④结合RRT与B样条完成平滑路径规划与优化。; 阅读建议:建议读者结合Matlab代码动手实践,先从运动学建模入手,逐步深入动力学分析与神经网络训练,注重理论推导与仿真实验的结合,以充分理解机械臂控制系统的设计流程与优化策略。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值