Deployment & Getting Start

System Requirements

The system requires the following items before launch. ASP.NET State Service is not required which depends on the session state server configuration in web.config. By default, it's configured to local session state service.
  • .NET Framework 3.5 SP1
  • MS SQL Server 2005 (Express Edition) +
  • Internet Information Service

Setup Database

Create a new database in your database Server, Go to %YOURDIRECTORY%\SQL, there are three DB scripts. You should execute them against the database in the order,
  • Database.sql
  • SchemaVersions.sql

Setup Xml Schema

Copy these xml schema to the directory %VSTS%/ Xml\Schemas so that you can get the intellisense in Visual Studio:
  • DynamicPage.xsd;
  • SiteMapConfig.xsd;
  • PermissionConfig.xsd

Deploy

Go to the directory %YOURDIRECTORY% and open RapidWebDev.sln in Visual Studio.NET. Double click the web.config, go to the ConnectionStrings section, abd modify your connection property there.
<connectionStrings>
    <add name="Global" providerName="System.Data.SqlClient" connectionString="XXX" />
</connectionStrings>

There are 3 default restful services configured in web.config. They're OrganizationService, RoleService and HierarchyService which have been used in the default RapidWebDev web application. You should configure the endpoint address of each service map to your access URL. Take an example. If your access URL is http://localhost:50682/LogOn.aspx, you should configure them as following

<service name="RapidWebDev.Platform.Services.OrganizationService" 
	behaviorConfiguration="AuthenticationBehavior">
	<clear />
	<endpoint name="RestfulOrganizationService" 
		address="http://localhost:50682/Services/OrganizationService.svc" 
		behaviorConfiguration="RestfulEndpointBehavior" 
		binding="webHttpBinding" 
		bindingConfiguration="HttpStreaming" 
		contract="RapidWebDev.Platform.Services.IOrganizationService" 
		listenUriMode="Explicit" />
	<endpoint address="mex" binding="mexHttpBinding" 
		bindingConfiguration="HttpStreaming" contract="IMetadataExchange" />
</service>
<service name="RapidWebDev.Platform.Services.RoleService" 
	behaviorConfiguration="AuthenticationBehavior">
	<clear />
	<endpoint name="RestfulRoleService" 
		address="http://localhost:50682/Services/RoleService.svc" 
		behaviorConfiguration="RestfulEndpointBehavior" 
		binding="webHttpBinding" 
		bindingConfiguration="HttpStreaming" 
		contract="RapidWebDev.Platform.Services.IRoleService" 
		listenUriMode="Explicit" />
	<endpoint address="mex" binding="mexHttpBinding" 
		bindingConfiguration="HttpStreaming" contract="IMetadataExchange" />
</service>
<service name="RapidWebDev.Platform.Services.HierarchyService" 
	behaviorConfiguration="AuthenticationBehavior">
	<clear />
	<endpoint name="RestfulHierarchyService" 
		address="http://localhost:50682/Services/HierarchyService.svc" 
		behaviorConfiguration="RestfulEndpointBehavior" 
		binding="webHttpBinding" 
		bindingConfiguration="HttpStreaming" 
		contract="RapidWebDev.Platform.Services.IHierarchyService" 
		listenUriMode="Explicit" />
	<endpoint address="mex" binding="mexHttpBinding" 
		bindingConfiguration="HttpStreaming" contract="IMetadataExchange" />
</service>

Register verification entries for unsigned RapidWebDev projects in source package
We don't publish the private strong name key file mapping to "RapidWebDev.public.snk" which referenced by almost RapidWebDev projects. Because we think the private key file is the evidence that the RapidWebDev assemblies in your machine are officially released by us.

So if you're launching Web from source package, you have to register verification entries for unsigned assemblies. We have implemented the verification entries registration in post-build event of Web and Tests projects. When you compile either of these two projects, verification entries registration will be completed automatically.

But some developers still encountered the unsigned-assembly issue when launching Web projects. If you get such issue, please run CheckVerificationEntries.bat to check whether the assemblies are registered successfully. The correct results should be the similar to the following screenshot.



But if you're using release package, you don't have such problem. We have signed RapidWebDev assemblies in the directory Library and remove public key file reference from the web project. You may add your own strong name file into the web project once you decided to develop the business based on it.

Log On
Finally, compile the whole solution and view LogOn.aspx in browser. The initial user name is "admin" and password is "password1".

Develop Your First Sample Application

Web Project Introduction

  • \Config is used to store web configuration files. permissions.config is used to configure whole permission set for users of the system. sitemap.config is used to configure navigation.
  • \Spring is used to store both Spring.NET IoC configuration files and dynamic page configuration files. The dynamic page configuration file name is in the format "*.dp.xml".

Quick Example

Suppose you are going to create a page to manage products.

Step1. Create a table names Product in your DB
Create Table t_product (Id uniqueidentifier, ApplicationId uniqueidentifier ,Name varchar(100));

Step2. Create linq2SQL dbml mapping to the data table

Step3. Add a new class in your project and name it as ProductManagement which inherits from RapidWebDev.RapidWeb.DynamicPages.DynamicPage And override Query method.
public override QueryResults Query(QueryParameter parameter)
{
    var predicate = parameter.Expressions.Compile();

    string sortingExpression = null;
    if (parameter.SortExpression != null)
        sortingExpression = parameter.SortExpression.Compile();
    if (Kit.IsEmpty(sortingExpression))
        sortingExpression = "LastUpdatedDate ASC";

    using (YourDataContext ctx = new YourDataContext())
    {
        int recordCount;
        var q = ctx.t_products.Where(predicate.Predicate, predicate.Parameters);
        q = q.OrderBy(sortingExpression);

        recordCount = q.Count();

        var products = q.Skip(parameter.PageIndex * parameter.PageSize)
			.Take(parameter.PageSize).ToList();
        return new QueryResults(q.Count(), products);
    }
}

Step4. create an dynamic page configuration file ProductManagement.dp.xml and store into \\Web\Spring\DynamicPage\YourProject\
<?xml version="1.0" encoding="utf-8" ?>
<Page xmlns="http://www.rapidwebdev.com/schemas/dynamicpage" 
	ObjectId="ProductManagement" 
	Type="RapidWebDev.Platform.Web.DynamicPageProductManagement, RapidWebDev.Platform">
	<Title>Product</Title>
	<PermissionValue>Everyone</PermissionValue>
	<Panels>
		<QueryPanel HeaderText="Product Managment">
			<TextBox FieldName="ProductName" Label="Product Name: " />
		</QueryPanel>

		<ButtonPanel ButtonAlignment="Left">
			<Button CommandArgument="New" Type="NewImage" ToolTip="Add new Product" />
		</ButtonPanel>

		<GridViewPanel
			HeaderText=" Product Name"
			EntityName="Product"
			EnabledCheckBoxField="true"
			PageSize="25"
			PrimaryKeyFieldName="id"
			DefaultSortField="Name"
			DefaultSortDirection="ASC">
			<ViewButton />
			<EditButton />
			<DeleteButton />
			<Fields>
				<Field FieldName="Name" HeaderText="Name" />
			</Fields>
		</GridViewPanel>
		
		<DetailPanel HeaderText="Product Profile" ShowMessageAfterSavedSuccessfully="false">
			<Type>
			RapidWebDev.Platform.Web.DynamicPage.ProductDetailPanel, RapidWebDev.Platform
			</Type>
			<SkinPath>~/Templates/Platform/Product.ascx</SkinPath>
			<SaveButton />
			<CancelButton />
		</DetailPanel>
	</Panels>
</Page>

In this dynamic page, we have a query panel to set query filters; grid panel to display query results; detail panel to add/update/view a product.

Step5. Now we can add a link to sitemap.config with setting permission value to EveryOne. Then every authenticated user can get it in left navigation panel of main page.
<Item Text="Workflow">
    <Item Text="ProductMgr" PageUrl="~/ProductManagement/DynamicPage.svc" Value="Everyone" />
</Item>

Last edited Mar 22, 2010 at 9:29 AM by eungeliu, version 26

Comments

extremesofts Dec 30, 2010 at 5:58 PM 
I got a lot of possibilities and interests to do works with it. Feed back you soon.