Saturday, September 04, 2010
Categories
Author:Marian D.Created:7/23/2006 5:27 PM
  

Starting with version 3.0.7 (for DNN 5.x) and 2.0.6 (for DNN 4.x) mobiNuke is exposing a rich set of mobile device capabilities available to be used by module or skin developers.
It is possible now to know for example, dimension of the screen, maximum colors accepted, if JavaScript or video streams  are supported.

image

 

To get these capabilities in your code, include a reference to DataQ.mobiNukeLibrary in your project and follow the example in this sample code:

 Dim context As System.Web.HttpContext = HttpContext.Current
 'get the capabilitiesGetter from the context scope.
 'if this device is not mobile device, it will not be present
 If context.Items.Contains("wurlf") Then
 
 Dim wurlf As DataQ.Modules.mobiNuke.capabilitiesGetter = Nothing
                    wurlf = context.Items("wurlf")
 
 'write a set of most usefull capabilities
                    Label_SelectedCapabilities.Text = "<h3>Selected Set of<br> Device Capabilities</h3>"
 
                    Label_SelectedCapabilities.Text &= "model_name=" & wurlf.getCapability("model_name") & "<br>"
                    Label_SelectedCapabilities.Text &= "mobile_browser=" & wurlf.getCapability("mobile_browser") & "<br>"
                    Label_SelectedCapabilities.Text &= "has_qwerty_keyboard=" & wurlf.getCapability("has_qwerty_keyboard") & "<br>"
                    Label_SelectedCapabilities.Text &= "ajax_support_javascript=" & wurlf.getCapability("ajax_support_javascript") & "<br>"
                    Label_SelectedCapabilities.Text &= "cookie_support=" & wurlf.getCapability("cookie_support") & "<br>"
                    Label_SelectedCapabilities.Text &= "resolution_width=" & wurlf.getCapability("resolution_width") & "<br>"
                    Label_SelectedCapabilities.Text &= "resolution_height=" & wurlf.getCapability("resolution_height") & "<br>"
                    Label_SelectedCapabilities.Text &= "colors=" & wurlf.getCapability("colors") & "<br>"
 
 'write all capabilities
                    Label_AllCapabilities.Text = "<h3>All Device Capabilities</h3>"
 Dim is_wireless_device As Boolean
                    is_wireless_device = wurlf.getCapability("is_wireless_device")
 Dim deviceCapabilities As Hashtable = wurlf.getAllCapabilities()
 For Each capName As String In deviceCapabilities.Keys
                        Label_AllCapabilities.Text &= capName & "=" & deviceCapabilities(capName) & "<br>"
 Next
 End If

 

To illustrate this new feature, I created a very simple module that displays these capabilities. You must have mobiNuke installed in order for this to work. You can download the sample code from here

For the complete list of capabilities, click here.

Starting with version 3.0.7 (for DNN 5.x) and 2.0.6 (for DNN 4.x) mobiNuke is exposing a set of mobile device capabilities obtained through WURLF library.

Read More »

Before mobiNuke version 3.0.6 I used to maintain a mobile version of HTML module as part of mobiNuke. Starting with 3.0.6 this is no longer happening. The problem is that when you upgrade, pervious files are still there, and it may throw some errors.

 

There are two options:

1. Uninstall old mobiNuke version and choose to delete files. Then install the new version.

2. Install the new version of mobiNuke over the old one, and delete this folder: [website]\DesktopModules\mobiNuke\desktopmodules\html

 After applying SP1 you may see this error in your Application event log:

 Retrieving the COM class factory for component with CLSID {3D42CCB1-4665-4620-92A3-478F47389230} failed due to the following error: 80070005.
 
This is a security error. To fix this you need to reconfigure security entries for OSearch DCOM component. Follow these steps:
  • Go to Start --> Administrative Tools Component Services 
  • Expand Component Services --> Computers --> My Computer --> DCOM Config
  • Find Osearch, right click and select Properties
  • Select Security tab
  • Edit Launch and Activation Permissions
    • Add WSS_ADMIN_WPG with Local Launch and Local Activation
    • Add WSS_WPG with Local Launch and Local Activation
  • Edit Access Permissions
    • Add WSS_ADMIN_WPG with Local Access
    • Add WSS_WPG with Local Access
 

As part of the sequel “How to do simple things in DotNetNuke after you created your first module”, I’ll show you today how to recognize inside your module, when the page is in edit mode and when is in preview mode. 
 
 Me.EditMode property is not enough to show this state of the page. You need also to evaluate the a cookie used to indicate if the page is in preview or not.
  
If Me.EditMode Then
  Dim objPreview As HttpCookie
  objPreview = Request.Cookies("_Tab_Admin_Preview" & PortalSettings.PortalId.ToString)
  If Not objPreview Is Nothing AndAlso CType(objPreview.Value, Boolean) Then
   'the page is in preview mode
   '...
  
Else
   'the page is in edit mode
   '...
  
  End If
End If
  
This is useful, obviously when you want to show different things when the page is in edit mode rather than preview.

This snippet of code shows you how to programmatically create a page (tab) in DotNetNuke 4.x from a template.
It is called from the context of a module, so we have access to some of the main objects of DNN framework, such as PortalSettings.
Few properties are copied from the current active page: TabPermissions, SkinSrc, ContainerSrc. With a little effort you can specify your own values, if these ones are not appropriate.
 
The most important point is the use of the page template. By default, DotNetNuke comes with one template that is adding a HTML module to the main ContentPane. This template is placed in “…\Portals\_default\Templates\ Default.page.template” file. It is a XML file and you can easily change it or clone it to create your own template.
 
        'create new hidden page
        Dim ctrTab As New DotNetNuke.Entities.Tabs.TabController
        Dim objTab As New DotNetNuke.Entities.Tabs.TabInfo
        Dim objActiveTab As DotNetNuke.Entities.Tabs.TabInfo
        objActiveTab = Me.PortalSettings.ActiveTab
        objTab.IsVisible = False
        objTab.PortalID = Me.PortalId
        objTab.TabID = Null.NullInteger
        objTab.PortalID = PortalId
        objTab.TabName = "Page Name"
        objTab.Title = "Page Name"
        objTab.Description = "Description"
        objTab.KeyWords = ""
        'we make it hidden this time
        objTab.IsVisible = False
        objTab.DisableLink = False
        objTab.ParentId = -1
        objTab.IconFile = ""
        objTab.IsDeleted = False
        objTab.Url = "N"
        'get the same permissions as the current active page
        objTab.TabPermissions = objActiveTab.TabPermissions
        'get the same skin as the current active page
        objTab.SkinSrc = objActiveTab.SkinSrc
        objTab.ContainerSrc = objActiveTab.ContainerSrc
        objTab.TabPath = GenerateTabPath(objTab.ParentId, objTab.TabName)
        objTab.StartDate = Null.NullDate
        objTab.EndDate = Null.NullDate
        objTab.PageHeadText = ""
        objTab.TabID = ctrTab.AddTab(objTab)
        'create the page from our template
        Dim xmlDoc As New System.Xml.XmlDocument
        xmlDoc.Load(Server.MapPath(Me.Page.TemplateSourceDirectory & "/Portals/_default/Templates") & _
        "\Default.page.template")
        Dim objPortals As New PortalController
        objPortals.ParsePanes(xmlDoc.SelectSingleNode("//portal/tabs/tab/panes"), _
                              objTab.PortalID, objTab.TabID, PortalTemplateModuleAction.Ignore, New Hashtable)
 
I will conclude that creating pages programmatically is not complicated in DotNetNuke, and can be useful in the process of custom module creation, when we want to save the admin user few extra steps.

 

Here is a list of features I am currently working on for next release of zsReport:

  • Localization.
  • Support for linked reports
  • My Favorites reports
  • Top 10 Reports eventually by category. (Add categories).
  • Improve visual look.
  • Get better at running multiple modules on the same page. Good for building dashboards.
  • Allow the admin to control the target of the links (drill-downs) in reports.
  • Allow parameter zone and toolbar to be hidden or visible.
  • Build DNN specific subscription rather than using Reporting Services server side subscription.
  • Thumbnail view of the reports list. With automatic or on demand thumbnail generation.
  • Improve administration and management functions: usage activity reports, update and upload etc
  • Allow multiple source of Reporting Services Servers to be merged into the same module.
  • Improve social functions: share-it, email-it, digg-it etc. Expose RSS feed as an option. Admin controllable.
  • Integrate with Business Objects reports.
  • Change the name of the module to zsReport (to incorporate with other products of mine)

The problem I have with dnn module installer/packager is that I cannot pack files with same name that reside in different locations of your module subfolders.

Read More »

If you want to export/import ColdFusion server settings you should read this: http://www.doughughes.net/index.cfm?event=viewEntry&entryId=73

Read More »

Four steps for migrating HTML module source code from DNN 3 to DNN 4

Read More »

Privacy Statement  |  Terms Of Use
Copyright 2010 by Data Quadrant, Inc.