DotNetNuke ® Portal and Module Development - www.schelian.com

 Search



Weblog


 Blog Archive Minimize

 DotNetNuke.Com Blogs Minimize


 Create a Private Assembly for DotNetNuke 3.X Minimize
Location: BlogsHP's Blog (www.schelian.com)Development    
Posted by: Hans-Peter Schelian 12/11/2004 1:26 AM
This is a translation of my Article "Erstellen eines Private Assembly für DotNetNuke 3.X." In this article I describe the use of PACT Tool (DNNPortal Version) to create a Private Assembly for DotNetNuke 3.X.. It is a step by step description to create an PA, add it to DotNetNuke projekt, register it to DotNetNuke and insert it in a TAB.

Intro




This is a translated version of my german Article "Erstellen eines Private Assembly für DotNetNuke 3.X.




I hope my english ist good enough that you don't have problems to read and understand my article.




This is the first version, not really spell checked, If you have any annotations, suggestions, corrections or anything else please left me a comment, so that I can fix these things in my article.




Hope you find the information well.




Now have fun to read the article




Author: Hans-Peter Schelian 11.12.2004

















Basic framework for PA creation




In order to produce the basic framework for a Private Assembly, it offers to intercede at the tool PACT (PACT is a tool which is published from Todd Davis as Open Source, so my advanced version is open source also).




The PACT Tool used for this article is an advanced version, which is available in the download area. Why an advanced version ? 
It is quite simple: There are some bugs in the original version which I have fixed.




This tool creates the whole Visual Basic project including all the required source code data files.




Additionally, PACT can bind the Private Assembly project directly into the DotNetNuke project.




With another option, it is even possible to generate the necessary references for the Private Assembly to to the BuildSupport project.




The use of PACT (DNNPortal version)




The application of PACT is astonishingly simple.




Guarantee that no other application has open the project data files of DotNetNuke.




In order to use the PACT tool, you must only unzip the files to a directory on your computer. Now you can start PACT.EXE.




You should see the following input form after the program is started:










Namespace









In the field Namespace, input the Namespace of your PA  (mostly your company name)



Module Name





Input the name of the Private Assembly into this field, this is also the name of the directory which will be created under the directory C:\DotNetNuke\DesktopModules.



Project Location





At this place, you must input the DotNetNuke root folder. Since PACT places all other directorys relatively from this directotry, no other dirctory can be declared here.



Result Pane





During the processing with the PACT tool, you get the work steps recorded here.



Options



Depend on the selected options, following functions are executed:







The created project will be added to the Visual Basic project.



The data file DotNetNuke.SLN becomes on this occasion altered. (Always secure this data file previously)






By this option, the references on the Private Assembly will be added to the BuildSupport project.



The data file C:\DotNetNuke\Solutions\DotNetNukeAll\BuildSupport\BuildSupport.vbproj will be altered throug this option. (make a backup copy before)




Through adding into the BuildSupport project it is guaranteed, that your DLL files will be automatically copied to the DotNetNuke BIN directory.







You always should activate this option. Hereby it is guaranteed that possibly existing project data files of your Private Assemblys are entitled by the new ones.
Of course you can use this option no longer, if you input already code into your Private Assembly.



However, there is not any more necessity either to use the PACT tool for an already existing PA once again.



Create the PA






After you selected your options, actually always activate all options, you start the creation of the Private Assembly by clicking the button Create PA 




Please press this button only once. As soon as seeing something in the Result Pane, the operation is already finished.




Now, you can exit the PACT tool.







Create Private Assembly



After you create the private Assembly with the PACT tool, you should open the DotNetNuke project with Visual Studio (DotNetNuke.sln in the DotNetNuke directory).




If you opened Visual Studio with the DotNetNuke project, you should see two new projects in your project explorer.




In our example, this looks like this:






This are the two projects in this example:








  • DNNPortal.ImageLink


  • DNNPortal.ImageLink.SqlDataProvider



Furthermore, BuildSupport has added the two references in the project for your Private Assembly, see following copy:







2.1 Compile the PA



Now, it is time to compile our new Private Assembly for the first time.



Move the mouse pointer to this over your project [Namespace]. [module name] in our case therefore DNNPortal.Image link, click the right mouse button and chooses the command of build from the context menu




 




Then repeat the whole process for the DataProvider, therefore in our example DNNPortal.Image link.SqlDataProvider



Now, we can start the whole project with F5, if you have done everything as described, the project now should start quite normally.





Register PA Modul in DotNetNuke



Now, it is time to register our new module in DotNetNuke manually. A PA installation is not yet possible since we don't have still any installation routine for the module at this time.



As first, we start DotNetNuke, either in the development environment or in the standard installation through input of localhost/dotnetnuke in the internet browser.



Now, you must login as host in DotNetNuke, in order to be able to access the functions of the host settings.



After your login, open Modules Defintion under the host menu



Register the Module







Now, we must proceed as follows to register our new Private Assembly in DotNetNuke:







Select the menu Add New definition module:







Now input following values:







This is module name is the name of the Private Assembly, therefore in our case imagelink, don't use the leading namespace in that case.







In the field description, you input a description of your module (Optional).




The fields version and premium are not filled.




Now, the input form should look like follows:







Now you click on Update.







Create Definition




Now, you must create a new definition:




You proceed to it as follows:







Input the name of your PA into the field New Definition, in our case ImageLink




Now click on Add definition




Now, your input form should look like follows:







Register Controls



Now, we must add the used controls.




Click to this on Add Control and obviously input the values like in the following copy:







Please don't input any other values, only the values seen in screenshot above.




The control which we added is the control which displays the module information on our WEB Page.




Next, we still must add the control for editing the module data.




To do this click again on Add Control and input the below represented values in the input fields:







Have attention only fill out the fields shown in screenshot above.




Click the Update Button and verify that the entries are correct.




The correct settings you can see on the following screenshot:







If your settings as is shown, you can leave the module.







Test your PA



If you have done all preceding steps, now you can insert the new module on a TAB.




I create for test purposes always a new Tab, this has the advantage if something goes really crooked, I can simply delete the whole TAB and can start from the beginning.



Therefore, we produce a new TAB:  Let's simply call it ImageLinkTAB.



After the new TAB is created, you can select the module from the module list







Select the module ImageLink.




Now click on add module in the admin pane on the top to insert the module to the TAB.







You see the new module ImageLink in the following screen shot.




At this place, no own functionality still exists. However, what already is given is the generic function Add of New ImageLink like in the following representation:







And the menu to processing the standard functions of a DNN Modules also exists.







Consider, however, that you partially only still must implement the functionality for these functions in your PA.




Hereby I would like to finish this small instruction about the creation of a Private Assembly for DotNetNuke 3.X .




In a short time, a complementary instruction about the programming of a PA follows.




Have fun while programming



Hans-Peter Schelian




Original Articel in German


Article Todd Davis PACT Tool

Permalink |  Trackback

Your name:
Title:
Comment:
Add Comment   Cancel 

 Search NewBlog Minimize


 Blog List Minimize

Page generated in 0.7343468 seconds.