9 |
Christoc.com DnnMvcModule Module
10 |
11 |
* Important *
12 |
13 | When creating a project using this template, you should have named your project
14 | simply "ModuleName", not "Christoc.comModuleName". If you didn't do this, the
15 | easiest thing to do is close the solution, delete the folder from your DesktopModules
16 | folder, then create a new project.
17 |
18 |
19 | Due to limitations in the templating capabilities of Visual Studio, you will need
20 | to make some minor changes, and double check a few things, before you package this module.
21 |
22 |
23 | -
24 | Open up IIS Manager (start>run>INETMGR), go to your DNNDEV.ME website and make sure that DesktopModules is NOT a Virtual Directory/Application, if so, remove that.
25 |
26 | -
27 | If you change the TARGET framework for the project, remove the WEB.CONFIG file that Visual Studio will add to your project.
28 |
29 | - BEFORE checking the
30 | module into your source control environment check the following.
31 | - Edit the Project properties by double-clicking on the Properties folder in Solution
32 | Explorer
33 | - On the Web tab:
34 |
35 | - Under 'Start Action', make sure to set your Start URL to the correct site (ex: http://dnndev.me/).
36 | - Under 'Servers', make sure to "Use IIS Web Server" with a project url of http://dnndev.me/desktopmodules/DnnMvcModule
37 | and an Override application root URL of http://dnndev.me/
38 |
39 |
40 |
41 |
42 |
DotNetNuke Module Development Tutorials
43 |
44 |
45 |
49 |
50 |
Steps after your project is setup.
51 |
52 | - To Build and Package your Module you need to change to Release mode and then
53 | simply choose Build from the Build menu. The MSBuild scripts will do the packaging
54 | process for you. The packaging process creates an INSTALL and a SOURCE package in
55 | the INSTALL folder within your desktopmodule/modulename folder.
56 | - Installing your module in your development DotNetNuke instance is easy.Take the
57 | INSTALL ZIP file that is created in the INSTALL folder, upload that using the Host/Extensions
58 | page, Installation Wizard. Using the INSTALL ZIP file will overwrite the files already in this folder,
59 | but that shouldn't cause any problems as long as you install a recent build.
60 | - After you've done a release for your module (typically deploying to an environment
61 | outside of your development environment) you should change the Version number, you
62 | need to do this in two places, the assemblyinfo file, and the .DNN manifest file.
63 | Next time you build the module in release mode you will get a new package (using
64 | the version number) created.
65 | - For more information visit our DotNetNuke Consulting page.
66 |
67 |
68 | After you are finished reading this Documentation you can delete the Documentation directory
69 | from your project.
70 |
71 |
72 |
73 |
74 |
75 |
76 |
--------------------------------------------------------------------------------
/src/DnnMvcModule/License.txt:
--------------------------------------------------------------------------------
1 |
2 |
License
3 |
4 | Christoc.com http://www.christoc.com
5 | Copyright (c) 2015
6 | by Christoc.com
7 |
8 |
9 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
10 | documentation files (the "Software"), to deal in the Software without restriction, including without limitation
11 | the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
12 | to permit persons to whom the Software is furnished to do so, subject to the following conditions:
13 |
14 |
15 | The above copyright notice and this permission notice shall be included in all copies or substantial portions
16 | of the Software.
17 |
18 |
19 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20 |
21 |
--------------------------------------------------------------------------------
/src/DnnMvcModule/Models/Item.cs:
--------------------------------------------------------------------------------
1 | /*
2 | ' Copyright (c) 2015 Christoc.com
3 | ' All rights reserved.
4 | '
5 | ' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
6 | ' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
7 | ' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
8 | ' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
9 | ' DEALINGS IN THE SOFTWARE.
10 | '
11 | */
12 |
13 | using System;
14 | using System.Web.Caching;
15 | using DotNetNuke.Common.Utilities;
16 | using DotNetNuke.ComponentModel.DataAnnotations;
17 | using DotNetNuke.Entities.Content;
18 |
19 | namespace Dnn.Modules.DnnMvcModule.Models
20 | {
21 | [TableName("DnnMvcModule_Items")]
22 | //setup the primary key for table
23 | [PrimaryKey("ItemId", AutoIncrement = true)]
24 | //configure caching using PetaPoco
25 | [Cacheable("Items", CacheItemPriority.Default, 20)]
26 | //scope the objects to the ModuleId of a module on a page (or copy of a module on a page)
27 | [Scope("ModuleId")]
28 | public class Item
29 | {
30 | ///