Ewl » Canonical The canonical version of EWL Read More
Clone URL:  
README.md
View Markdown
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
# [Enterprise Web Library](http://enterpriseweblibrary.org/) The Enterprise Web Library (EWL) is an extremely-opinionated NuGet package designed to help you build web-based enterprise software on the .NET Framework. See [our web site](http://enterpriseweblibrary.org/) for more information. ## Table of Contents * [Introduction](#introduction) * [Getting Started](#getting-started) * [Documentation](#documentation) * [Support](#support) * [Contributing](#contributing) ## Introduction [William Gross](http://wgross.net/) and Greg Smalter launched this project back in 2004, in closed-source form, as a "standard library" that would eliminate a lot of the duplication that existed across the various line-of-business web applications that they maintained for their clients. It was successful, and after steady improvement each year, they open-sourced the entire library in 2012. William has been the lead developer ever since. EWL uses the [MIT License](http://opensource.org/licenses/MIT) and is in production use at [several organizations](http://enterpriseweblibrary.org/usedby/). ## Getting Started **Please note:** While EWL has been in production use for many years, this Getting Started guide is brand new. If you run into problems please let us know in our [community forum](https://community.enterpriseweblibrary.org/) and one of the developers will help you out. ### Requirements * Windows 8.1, .NET Framework 4.5.1, IIS Express 8.5 (.NET Core support is on the roadmap but please [speak up](https://community.enterpriseweblibrary.org/) if you're interested!) * Visual Studio 2013 (recommended) * SQL Server 2012 or later, MySQL 5.5, or Oracle Database 12c (if you want a relational database) For servers, the only requirement is Windows Server 2012 R2 with IIS enabled. ### Creating a New System 1. Visit http://ewl.enterpriseweblibrary.org/create-system to download a ZIP file containing your new starter system. Extract the files into a location of your choice. 2. Open the solution file in Visual Studio. In the Package Manager Console, run `Get-Project -All | Install-Package Ewl`. Save all files in the solution (Ctrl-Shift-S). 3. Again in the Package Manager Console, run `Update-DependentLogic`. This will do the following: * Apply some IIS Express configuration * Copy some files into the `Web Site` project, and update the project file to reference them * Generate a few pieces of code in both projects, and update the Web.config file 4. Understand the elements of your new system: * The `Library` project, which contains configuration files, provider classes (which allow parts of EWL's behavior to be customized), and a `GlobalInitializer` class (which gives you a place to initialize static fields when your system starts up). `Library` should also be the home of most of your "business logic" and anything else that you would reuse across multiple applications in your system. Right now your system only contains a single web app, but as it grows, you may need another web app or a different type of application, e.g. a Windows service. * The `Web Site` project, which references `Library` and will contain your pages and other resources. More information on this is available from our developers; please [ask for help in the forum](https://community.enterpriseweblibrary.org/). 5. Run the `Web Site` project. If you see a page that says "The page you requested is no longer available", everything is working and you can begin building your system. ### Adding a Database 1. Create a SQL Server, MySQL, or Oracle database using your preferred tool. We recommend the following naming conventions: * For SQL Server, name your database `SystemShortNameDev`, replacing `SystemShortName` with the value from your `General.xml` configuration file. * For MySQL, name your schema `system_short_name_dev`, replacing `system_short_name` with a lowercased, underscore-separated version of the value from your `General.xml` configuration file. * For Oracle, name your schema whatever you like. We have no convention. The MySQL convention may work. Additionally, for SQL Server, we suggest using this script to create the database (after replacing `DatabaseName` and `Path`): ```SQL USE Master CREATE DATABASE DatabaseName ON ( NAME = Data, FILENAME = 'Path\DatabaseNameData.mdf', SIZE = 100MB, FILEGROWTH = 15% ) LOG ON ( NAME = Log, FILENAME = 'Path\DatabaseNameLog.ldf', SIZE = 10MB, MAXSIZE = 1000MB, FILEGROWTH = 100MB ); GO ``` 2. Run one of the following scripts to initialize your database for EWL usage: [SQL Server](Documentation/ReadMeSupplements/DatabaseInitScripts.md#sql-server), [MySQL](Documentation/ReadMeSupplements/DatabaseInitScripts.md#mysql), [Oracle](Documentation/ReadMeSupplements/DatabaseInitScripts.md#oracle). 3. Add the `<database>` element to the installation configuration files (i.e. the `Standard.xml` files in `Library/Configuration/Installation/Installations`) after the `<administrators>` element: * For SQL Server, use `<database xsi:type="SqlServerDatabase" />`. Use the `<database>` child element if you did not follow the naming convention above. * For MySQL, use `<database xsi:type="MySqlDatabase" />`. Use the `<database>` child element if you did not follow the naming convention above. * For Oracle, use `<database xsi:type="OracleDatabase">` with the `<tnsName>`, `<userAndSchema>`, and `<password>` child elements. 4. Add the `<database>` element to the development configuration file (i.e. `Library/Configuration/Development.xml`) after the `<webProjects>` element. Now, when you run `Update-DependentLogic`, data-access code will be generated for your database. ### Deploying Your System This section is more theoretical than practical since it's generally not a good practice to deploy enterprise software by hand, and without a continuous integration infrastructure. 1. In the Package Manager Console, run `ExportLogic`. 2. Somehow copy the exported logic and configuration to the server. 3. Create and initialize a database using the appropriate steps above. The database name should be slightly different; replace `Dev` or `_dev` with the short name of your installation from the configuration file. Also, for SQL Server, grant the `NETWORK SERVICE` account reader/writer access to the database. 4. Set up an IIS web site or virtual directory that points at the appropriate folder in the logic that you copied to the server in step 2. Run the application pool as `NETWORK SERVICE`. Some of the EWL developers use an internal product called the EWL System Manager, which builds, tests, and deploys EWL systems automatically. It's like an ultra-opinionated version of Heroku or AppHarbor. It can be run in the cloud or on-premises. [Let us know in the forum](https://community.enterpriseweblibrary.org/) if you are interested in using this. ## Documentation Our documentation is included in this repository, in the Documentation directory. See the [table of contents](Documentation/TableOfContents.md). ## Support ### Q & A We use the [enterprise-web-library tag](http://stackoverflow.com/questions/tagged/enterprise-web-library) on Stack Overflow for all Q&A. Please post your questions there. ### Community Forum Visit our [Community Forum](https://community.enterpriseweblibrary.org/), a place for EWL developers to hang out and talk about whatever is on their mind. ### Bug Reports and Feature Requests We currently use an internal task tracker, but please create an issue on GitHub if you encounter a bug or have a feature request. ## Contributing Code contributions are welcome! We will accept easily-mergeable changes as quickly as possible. We're working on writing up some detailed expectations, but for now, please refer to the opening section of the [excellent Roslyn contribution page](https://github.com/dotnet/roslyn/wiki/Contributing-Code) and read [Don't "Push" Your Pull Requests](http://www.igvita.com/2011/12/19/dont-push-your-pull-requests/). Please see our [documentation wiki](https://enduracode.fogbugz.com/default.asp?W5) for more information.