---------------------------------------------------
CSLA 2.0 CodeSmith Templates for VB
Version: 0.9.5 (release candidate)
Released: August, 29 2006
Author: VB Team
Download Site: http://www.codeplex.com/Release/ProjectReleases.aspx?ProjectName=CSLAcontrib
Workspace has moved from: http://workspaces.gotdotnet.com/cslavbtemplate
---------------------------------------------------
This is a collection of CodeSmith templates to generate CSLA 2.0 business objects for VB. We have converted the entire C# suite of templates to not only generate VB business objects but also to perform the task in VB. All aspects of the C# version has been included in this version and the objects created will work in an identical fashion. This includes support xml data source, view as data source, and partial class generation.
Unlike version 1.x, these templates no longer used TableSchema and ColumnSchema directly as data source to generate Csla business object. The current template uses custom classes called ObjectInfo and PropertyInfo. This implementation permits one template to have multiple data sources such as table, view, and xml file.
This collection of templates is design to work with the freeware version (v2.6) of CodeSmith as well as the retail version (v3.2).
This set of templates and the template base support code are provided free charge. You're free to use and modify anyway you want it. The only request is for you to give back and share any improvement made to these templates if you feel many would benefit from it. We reserve the right to include (or not include) any of your improvements in future version and in return give credit to you.
Enjoy them,
VB Team
===================================================
Contributor(s)
===================================================
- Allan Nielsen (Lead / Converted to VB)
- Ricky A. Supit (Original C# version)
- Jeff Turner (Developer)
- Tom Cooley (TEC)
Stored Procedure support.
===================================================
Known Issues
===================================================
- Split class by using partial classes requires Csla Framework version 2.0.1 or later. Initialize() method was added in this version so hook for validation rules can be initialized before AddBusinessRules method is called.
- Split class by using base/abstract class requires Csla Framework version 2.0.1 or later. The earlier version was not able to find DataPortal_xxx methods when it's in generic abstract class.
===================================================
How to Use
===================================================
Method A:
Generate single Business Object by directly open specific template for Csla object type.
1. Double click on template based on Csla object type.
2. Enter the following:
- ClassNamespace: type namespace of your generated object.
- ObjectName: type name of your generated object.
3. If you choose to generate your class based on a table
- RootTable: select table from table picker.
If you choose to generate your class based on a view
- RootView: select view from view picker.
- UniqueColumnNames: type unique column(s) on selected view.
If you choose to generate your class based on StoredProcedure (Fetch SP).
- RootCommand: select stored procedure from stored procedure picker.
- ResultSetIndex: change this value is the index is different from the result sets returned from sp. (this is usually the case for child object)
- UniqueColumnNames: required for child objects; type unique columns of chosen (ResultSetIndex) result set.
4. Based on your generation method, enter the following:
- GenerationMethod: Select one:
Single: to generate once and modify it as needed.
SplitBase: split classes using abstract class as base and implemented on user class.
SplitPartial: split classes using partial classes.
- ClassType: if you choose split method, select either 'generated' or 'user' class.
5. Security options on your generated object.
- AuthorizationRules: 'True' to include access security in factory methods.
- PropertyAuthorization:
To include property level access security. options are 'Both', 'Read', 'Write'
6. Click Generate Button to generate code.
7. Copy the generated template output and paste it into your project.
Method B:
Generate single Business Object by open a master template
1. Double click on Csla.cst
2. Enter the following:
- OutputToFile: 'True' to generate as file, or 'False' to generate on template output screen.
- OutputDirectory: select folder where output file will be generated.
- Template: select Csla object type.
3. Follow step 2 to 6 of Method A.
4. If you choose OutputToFile=False, Copy the generated template output and paste it into your project.
Method C:
Generate multiple Business Objects using xml source file.
1. Double click on CslaXml.cst
2. Enter the following:
- OutputToFile: 'True' to generate as file, or 'False' to generate on template output screen.
- OutputDirectory: select folder where output file will be generated.
- XmlFileName: select xml file from file picker.
3. Click Generate Button to generate files.
===================================================
Templates
===================================================
- EditableRoot (ER)
- EditableRootList (ERL)
- EditableChild (EC)
- EditableChildList (ECL)
- EditableSwitchable (ES)
- ReadOnlyRoot (ROR)
- ReadOnlyRootList (RORL)
- ReadOnlyChild (ROC)
- ReadOnlyChildList (ROCL)
- NameValueList (NVL)
- Csla
- CslaXml
===================================================
Parameters
===================================================
--------------------------------------------------------------------------------------------
Parameter Description Template
--------------------------------------------------------------------------------------------
ClassNameSpace Namespace of your generated object All
ObjectName Name of your generated object. All
ParentName Name of your parent object. EC, ECL, ES
ChildName Name of your list item/child object. ERL, ECL, RORL, ROCL
RootTable DB Table name to be used as data source. All
RootView DB View name to be used as data source. All
RootCommand DB Stored Procedure to be used as data source. All
XmlFileName Xml file contains metadata that describe CslaXml
the objects.
ResultSetIndex Result set index (zero based) which result set All
to use from the stored procedure.
UniqueColumnNames Unique column name(s) when RootView or ER, EC, ROR, ROC, ES
RootCommand is the data source.
FilterColumnNames Filter column name(s) as retrieve criteria ERL, RORL
when RootView is the data source.
ChildCollectionNames Child collection object name(s). ER, EC, ROR, ROC, ES
ChildPropertyNames Property name(s) accessing the child ER, EC, ROR, ROC, ES
collection object(s).
AuthorizationRules Option to include/exclude access security All
in factory methods.
PropertyAuthrization Option to include/exclude property level All
access security.
- Read : Access security on property getter.
- Write : Access security on property setter.
- Both : Access security on both getter and
setter
TransactionalType Data access transactional type.
没有合适的资源?快使用搜索试试~ 我知道了~
CodeSmith极其实用的MVC模板
共1736个文件
cst:618个
cs:279个
dll:195个
4星 · 超过85%的资源 需积分: 10 63 下载量 199 浏览量
2010-12-03
10:30:17
上传
评论 1
收藏 17.65MB RAR 举报
温馨提示
CodeSmith极其实用的MVC模板,用于MVC三层架构的自动生成,存储过程 业务实体类等等
资源推荐
资源详情
资源评论
收起资源包目录
CodeSmith极其实用的MVC模板 (1736个子文件)
Global.asax 79B
ucLogin.ascx 1KB
Pub_teacherEdit.aspx 9KB
Pub_teacherList.aspx 5KB
Pub_centerEdit.aspx 2KB
Pub_regionEdit.aspx 2KB
Pub_centerList.aspx 2KB
Pub_regionList.aspx 2KB
UserEdit.aspx 2KB
UserEdit.aspx 2KB
Pub_deptList.aspx 2KB
NewsEdit.aspx 2KB
NewsEdit.aspx 2KB
UserList.aspx 2KB
UserList.aspx 2KB
NewsList.aspx 2KB
NewsList.aspx 2KB
Pub_postInforList.aspx 2KB
Pub_deptEdit.aspx 2KB
Pub_postInforEdit.aspx 2KB
NewsTypeList.aspx 2KB
NewsTypeList.aspx 2KB
Default.aspx 1KB
NewsTypeEdit.aspx 1KB
NewsTypeEdit.aspx 1KB
Default.aspx 721B
Default.aspx 711B
Welcome.aspx 654B
Default.aspx 614B
ElfinNetDB.bak 979KB
GenerateCode.bat 383B
GenerateCode.bat 52B
GenerateCode.bat 50B
ResolveAssemblyReference.cache 11KB
ResolveAssemblyReference.cache 4KB
www.qupan.com_935963_CodeSmith 中文教程.chm 138KB
Web.config 4KB
MsmqDistributor.exe.config 2KB
MsmqDistributor.exe.config 2KB
MsmqDistributor.exe.config 2KB
Web.config 2KB
Web.config 2KB
app.config 1KB
EntLibConfig.exe.config 875B
EntLibConfig.exe.config 875B
EntLibConfig.exe.config 875B
App.config 622B
App.config 543B
App.config 272B
App.config 272B
app.config 252B
app.config 252B
App.config 99B
PrecompiledApp.config 49B
CommonCode.cs 248KB
CommonCode.cs 248KB
CommonSqlCode.cs 216KB
SqlSchemaProvider.cs 88KB
DynamicQuery.cs 87KB
TemplateBase.cs 86KB
OracleSchemaProvider.cs 82KB
OrdersDataSet.cs 78KB
ProjectHelper.cs 55KB
Sample.designer.cs 46KB
ProductDataSet.cs 42KB
DbmlReader.cs 40KB
MySQLSchemaProvider.cs 34KB
SqlScripts.Designer.cs 32KB
Pub_teacherDRBase.cs 31KB
DbmlGenerator.cs 29KB
SqlService.cs 29KB
SqlService.cs 29KB
SafeDataReader.cs 23KB
ADOXSchemaProvider.cs 23KB
SqlService.cs 23KB
NHibernateHelper.cs 22KB
CreateTemplates.cs 22KB
DbmlSerializer.cs 21KB
TypedDataSet.cst.cs 19KB
BizHelper.cs 18KB
Hashtable.cs 17KB
SqlCodeTemplate.cs 15KB
DbUtilities.cs 13KB
Pub_centerDRBase.cs 12KB
Order.cs 12KB
Pub_regionDRBase.cs 12KB
SQLUtil.cs 11KB
TypedDataSet.cst.cs 11KB
DbmlDefaultValueNullifier.cs 11KB
Pub_deptDRBase.cs 11KB
UserDRBase.cs 11KB
DbmlDuplicator.cs 11KB
Pub_teacherBase.cs 10KB
DbmlDefaultValueAssigner.cs 10KB
NewsDRBase.cs 10KB
CommonMembershipCode.cs 10KB
BizHelper.cs 10KB
Pub_postInforDRBase.cs 10KB
Utility.cs 9KB
NewsTypeDRBase.cs 8KB
共 1736 条
- 1
- 2
- 3
- 4
- 5
- 6
- 18
bulan1988
- 粉丝: 13
- 资源: 7
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
前往页