Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...Using DNN for Framework, but not modules?Using DNN for Framework, but not modules?
Previous
 
Next
New Post
3/22/2007 4:03 AM
 

Hi

I have done about 100 portals in a similar way. I only use dotnetnuke as the portal backend. The rest of the functionality I program as a seperate application that has nothing to do with dnn with allf unctionality in usercontrols. I then use the xepient smart module  for hanging these usercontrols in my portal.

In the excisting app i also have the abillity to include all dnn functionality, user checking etc.

For example http://www.politieknieuws.nl is a site like this. The entire portal uses only that one module, and in there several usercontrols to handle all the functionality that talks to our excisting news database.

 
New Post
3/22/2007 4:10 AM
 
Here is a sample uc setup to get you started ( this one is for asp.net1)

In a standard user control i start off with a lable and a panel for the error ( thsi will be used to show the correct error to the correct poeple ( admin/ non admin ) . In the panel I have a piece of text defining each of the common misstakes that have to do with my siteadmins filling in the wrong data for the public properties

test.ascx
asp:Label id="Label1" runat="server">Label</asp:Label
asp:Label id="lblError" runat="server" ForeColor="Red"></asp:Label
 asp:Panel id="PnlError" runat="server" Wrap="False" Visible="False">Explanation about error for admins</asp:Panel

codebehind

Imports DotNetNuke

Imports DotNetNuke.Entities.Portals

Imports DotNetNuke.Entities.Modules

Imports DotNetNuke.Common

Imports DotNetNuke.Common.Utilities

Public Class test

Inherits System.Web.UI.UserControl

Public testproperty As String

Protected WithEvents lblError As System.Web.UI.WebControls.Label

Protected WithEvents PnlError As System.Web.UI.WebControls.Panel

#Region " Web Form Designer Generated Code "

'This call is required by the Web Form Designer.

<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()

End Sub

Protected WithEvents Label1 As System.Web.UI.WebControls.Label

'NOTE: The following placeholder declaration is required by the Web Form Designer.

'Do not delete or move it.

Private designerPlaceholderDeclaration As System.Object

Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init

'CODEGEN: This method call is required by the Web Form Designer

'Do not modify it using the code editor.

InitializeComponent()

End Sub

#End Region

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

'

Try

'Dim modid As String = CType(Me.Parent, DotNetNuke.Entities.Modules.PortalModuleBase).ID.ToString

'DotNetNuke.Entities.Modules.VisibilityState.None()

Label1.Text = CType(testproperty, Integer) & "-" & Me.Parent.UniqueID & "-" & DotNetNuke.Common.Globals.NavigateURL

Catch oEx As Exception

Dim checkerror As ArrayList = Helper.DisplayError(oEx.Message)

lblError.Text = checkerror(0)

PnlError.Visible = checkerror(1)

Exit Try

End Try

End Sub

Private Sub CheckVisible()

Dim _portalSettings As PortalSettings = CType(HttpContext.Current.Items("PortalSettings"), PortalSettings)

Dim mUser As DotNetNuke.Entities.Users.UserInfo = DotNetNuke.Entities.Users.UserController.GetCurrentUserInfo

If mUser.UserID < 1 Then

'User Not Logged In

CType(Me.Parent.Parent, DotNetNuke.Entities.Modules.PortalModuleBase).ContainerControl.Visible = False

Else

If mUser.IsSuperUser Or mUser.UserID = _portalSettings.AdministratorId.ToString Then

'doe niks

Else

CType(Me.Parent.Parent, DotNetNuke.Entities.Modules.PortalModuleBase).ContainerControl.Visible = False

End If

End If

End Sub

End Class

helper.vb module

Imports DotNetNuke

Imports DotNetNuke.Entities.Portals

Imports DotNetNuke.Entities.Modules

Imports DotNetNuke.Common

Imports DotNetNuke.Common.Utilities

Module Helper

Public Function DisplayError(ByVal Message As String) As ArrayList

Dim strerror As String = ""

Dim blnAdmin As Boolean = False

Dim ArlError As New ArrayList

Dim _portalSettings As PortalSettings = CType(HttpContext.Current.Items("PortalSettings"), PortalSettings)

Dim mUser As DotNetNuke.Entities.Users.UserInfo = DotNetNuke.Entities.Users.UserController.GetCurrentUserInfo

If mUser.UserID < 1 Then

'User Not Logged In

strerror = "error for non logged in user

Else

If mUser.IsSuperUser Or mUser.UserID = _portalSettings.AdministratorId.ToString Then

'admin or host so general error and explanation

strerror = Message

blnAdmin = True

Else

'normal user so a general error

strerror = "error for normal user"

End If

End If

ArlError.Add(strerror)

ArlError.Add(blnAdmin)

Return ArlError

End Function

End Module


thats it the basic setuop I use for everythig. One tab has about 15 modules on it and based if there is data or not only the ones that have actual content are shown. So you need to check in your code if there is data returned and if not you call checkvisible()

Another point to take into notice if that ( at least for the version of the xepient mdoule now ) is that sometimes it blows on cast errors generated by the public properties.

to overcome this make all your public properties strings and then cast them to the type you need. Thsi way if its filled in incorrectly your try/catch will catch the error so it wont blowup your portal  ctype(myproperty, integer)


This should get you started using this module have funCool [H]
 
New Post
3/22/2007 9:59 AM
 
That is incredibly helpful!  However, after looking into the Xepient Open-SmartModule, I would likely need to do this a bit differently since I am using .Net 2.0 and the App_Code folder for now. 

I figure that I can make DNN modules very similar to the way that we are supposed to do with my set-up, only not reference the DNN data provider, rather my own.  Then install manually as a host.  This has worked really well for me with non-data reliant modules so far.

Will Strohl

Upendo Ventures Upendo Ventures
DNN experts since 2003
Official provider of the Hotcakes Commerce Cloud and SLA support
 
New Post
3/22/2007 2:13 PM
 

You can take that approach even for data intensive applications, look at the tutorial "Super-Simple Module (DAL+)" at Michael Washington's site.  You will see that you can do data access from your module without having to define all the components of the DAL.  I have used that approach very successfully.

Carlos

 

 
New Post
3/22/2007 3:07 PM
 

I would just mention there is nothing inherently special about the DAL+  once you go outside the DNN framework.   The DAL+ is based on the older version of the MS data access application block.  That app block has served me well and is very good code, but with ASP.NET 2.0, there are faster ways to get the job done.

If you are using ASP.NET 2.0, you can use all of the new data access features you would find on Scott Mitchell's tutorials on ASP.NET.  It takes a solid day, but you can go through all of his tutorials and when you are done, you're going to be flying with .NET DA.  It's kind of freaky to write almost zero code and see everything work, and it sort of feels like a regression to "bad VB" days, but in fact the underlying architecture, this time around, in my opinion, is very good.

 

 
Previous
 
Next
HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...Using DNN for Framework, but not modules?Using DNN for Framework, but not modules?


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out