DNN4 (DotNetNuke) 备忘录

 

环境:Visual Web Developer 2005 Express,DNN4 Starter Kit,C#

 

1,安装DNN

  • 改一下SQL Server连接信息和赋予文件系统目录和IIS虚拟目录相应权限即可顺利安装

2,下载安装第三方Module(.zip)

  • 使用Host->Module Definitions->Uplode New Module安装,或者
  • 拷贝到/Install目录下使用url “Install/Install.aspx?mode=InstallResources”安装(or through the Install Resources Scheduled Event.)

3,创建安装自定义Module

  • 使用Starter Kit创建并修改
  • 使用Host->Module Definitions->Add New Definitions安装
  • 或者使用xxx.sqldataprovider 脚本来将Module注册到DNN数据库中
  • 引用:

为了在DotNetNuke框架中注册模块,需要增加一些记录到数据库。可以通过Host下的模块定义来增加。为了开发方便,也可以使用Item Template来创建模块SQL脚本。这个脚本在DesktopModules目录下,和Add New Item输入的模块名一致 ( 例如这里名叫Widget.SqlDataProvider ).  

DotNetNuke
SQL脚本使用特殊的语法,以保证正确性。最简单的方法就是在DotNetNuke应用程序中执行这些脚本。在Visual Web Developer, Ctrl-F5,来启动应用程序,通过Host登陆(默认密码为"host")选择Host下的SQL项。
 
粘贴模块的SQL脚本,选中 Run As Script option,Execute.

模块内容已经存放到数据库里了,通过DotNetNuke模块模板创建的 01.00.00.SqlDataProvider SQL脚本,将用来在数据库里创建需要的表和存储过程。这些脚本放在  DesktopModules里,从 01.00.00.SqlDataProvider SQL 脚本文件里,拷贝并粘贴SQL脚本,选中 Run As Script option,Execute.

--from www.dnnchina.net

 

4,How to export/import module?   

  • DotNetNuke.Entities.Modules.IPortable?
  • Private Assembly Package, zip file(dll, ascx, dnn, db script, ...)

5, How to add/retrieve custom settings for module?

  • modify Settings.ascx to add new control
  • using DNN Framework setting service: ModuleSettings table: moduleId, key, value;

6, How to use custom database table for module?

  • in .SqlDataProvider script, add your table and stored procedure, then execute it.
  • in your xxxInfo class, add responding property.
  • in your SqlDataProvider class, add responding parameter.
  • Reference:
Each field in the data store should map to a corresponding property in the Info class. To allow the generic CBO helper class to automate the transfer of data from IDataReader to Custom Business Object, the directly related class properties and database fields MUST be identical in terms of Name and DataType.

As an example which demonstrates the steps involved in extending the core, we will assume we are adding a new Field to a core Table.

If necessary, change the Presentation Layer to display/edit the new field

Modify the associated Business Logic Layer ( BLL ) class to add the Field to the necessary methods ( typically AddTable, UpdateTable )

Update the DataProvider base class with the necessary changes from Step #2 and recompile the application.

Update each DataProvider subclass implementation ( ie. SqlDataProvider, AccessDataProvider ) with the necessary changes. Recompiling the applicatioin will reveal any discrepancies between the base class and implementation. The number of implementations which need to be modified is dependent on the number of different databases your application supports.

Update each DataProvider subclass implementation script with the specific database alteration commands ( ie. ALTER TABLE ). In the case of database providers which use stored procedures, the new versions of the stored procedures must be scripted as well (with associated DROP and CREATE commands ).

--from www.dotnetnuke.com

 

7, Structure for a module created by Starter Kit

  • BLL: app_code/modulename
  • DAL: app_code/modulename
  • View: desktopmodules/modulename
  • Admin(Edit&Setting): desktopmodules/modulename
  • "模板将创建一个自定义模块所需要的文件,包括SQL脚本文件,数据访问层,业务对象,用户接口和部署清单。也包括了在开发环境里的模块说明。"
     

8, Custom Experience

  • GetProfile/SetProfile to support custom experience.

 

Thinking in DNN

1, Platform

  • A couple of basic infrastructures, an extension mechanism, and an administrator tool.

2, Extra Middle Layer

  • Data Access Layer (DAL) be independent with Business Logical Layer (BLL), it use DataReader to pass data to up layer.
  • Business Logical Layer (BLL) be independent with Data Access Layer (DAL), it use Custom Business Object (CBO) to pass data to under layer.
  • Then how to match DataReader with CBO each other ? It be called Mapper Layer, or Mapper Pattern (POSA).
  • You will notice that the Controller methods which send information to the database ( ie. Add and Update ) pass a Custom Business Object instance as a parameter. The benefit of this approach is that the object definition is isolated to the BLL which reduces the modifications required to the application when the class definition changes. The individual object properties are then extracted and passed as Scalar values to the Data Access Layer ( this is because the DAL is not aware of the BLL object structures ).

 

Questions for DNN

  • 是否每个Module都最多只能有一个View,Edit,Setting控件文件(.ascx)?
  • how to seperate module project from DNN  using VWD Express?
  • Where could I get .Net Framework 2.0 Full Feature Description?
  • Where could I get C# 2.0 Full Feature?.

 

Memorandum

阅读更多
上一篇Programming Windows Batch Script
下一篇WebSphere Application Server V6 备忘录
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

关闭
关闭
关闭