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

HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsForm and ListForm and ListShow All Data as XML when not logged in as AdministratorShow All Data as XML when not logged in as Administrator
Previous
 
Next
New Post
2/27/2012 3:08 PM
 

Hi,

I am looking for a bit of assistance with the Form and List module, I searched the forum but couldn't find a similar case.

We are using the Form and List module to display a music chart here http://www.theedge.co.nz/Music/Fat40.... and I would like to provide the contents of this table to a 3rd party as XML.

So I figured that the "Show All Data as XML" feature would allow us to do this as it clearly shows all the data we need to pass on to the 3rd party. However, I am finding that it only shows XML when logged in as an Administrator but not when as an Unathenticated user (I have provided more detail further down this post).

Is there any way around this? Do I need so set a particular permission or check box somewhere?

Your help is very much appreciated.

Kind Regards,
Tom Jackson

-------------------------------------------------------------
The Issue in More Detail
-------------------------------------------------------------

When visiting this XML URL http://www.theedge.co.nz/DesktopModul... when not logged in (ie as an Unathenticated user) there is no response from the server. These are the response headers to further demonstrate that.

Accept-Ranges: none
Cache-Control: private
Content-Length: 0
Content-Type: text/plain
Date: Mon, 27 Feb 2012 19:57:11 GMT
Server: Microsoft-IIS/7.5
Via: 1.1 sophos1.canwest.co.nz:8080
X-AspNet-Version: 2.0.50727
X-Powered-By: ASP.NET
X-PvInfo: [S10201.C90252.A22957.RA22892.G1610A.U2D8630FA].[OT/other.OG/other] 

However, when logged in as a Administrtator and I visit the XML URL it shows me the XML as expected this

<UserDefinedTable xmlns="DotNetNuke/UserDefinedTable">
  <Data>
    <UserDefinedRowId>2602</UserDefinedRowId>
    <Created_x0020_by>M K</Created_x0020_by>
    <Created_x0020_at>2012-02-20T11:31:07+13:00</Created_x0020_at>
    <Changed_x0020_by>M K</Changed_x0020_by>
    <Changed_x0020_at>2012-02-20T11:31:07+13:00</Changed_x0020_at>
    <PLACE>1</PLACE>
    <CHANGE>0</CHANGE>
    <WEEKS_x0020_IN_x0020_CHART>5</WEEKS_x0020_IN_x0020_CHART>
    <PEAK>1</PEAK>
    <TITLE>Wild Ones</TITLE>
    <ARTIST>Flo Rida/Sia</ARTIST>
    <EditLink>http://www.theedge.co.nz/Music/Fat40/tabid/79/ctl/edit/mid/2087/Default.aspx?UserDefinedRowId=2602</EditLink>
    <Created_x0020_by_UDT_Original>mk@mwl.co.nz</Created_x0020_by_UDT_Original>
    <Created_x0020_by_UDT_Caption>M K</Created_x0020_by_UDT_Caption>
    <Created_x0020_at_UDT_Value>&lt;!--063465334267--&gt;2/20/2012 11:31 AM</Created_x0020_at_UDT_Value>
    <Created_x0020_at_UDT_Ticks>634653342670000000</Created_x0020_at_UDT_Ticks>
    <Changed_x0020_by_UDT_Original>mk@mwl.co.nz</Changed_x0020_by_UDT_Original>
    <Changed_x0020_by_UDT_Caption>M K</Changed_x0020_by_UDT_Caption>
    <Changed_x0020_at_UDT_Value>&lt;!--063465334267--&gt;2/20/2012 11:31 AM</Changed_x0020_at_UDT_Value>
    <Changed_x0020_at_UDT_Ticks>634653342670000000</Changed_x0020_at_UDT_Ticks>
  </Data>
 
  ... Lots of <data> nodes...
  ... Lots of <Fields> nodes...
  ... A <Context> node...
 
</UserDefinedTable>

...and these are the Response Headers when logged in as Administrator....

Accept-Ranges: none
Cache-Control: private
Content-Encoding: gzip
Content-Length: 3588
Content-Type: Text/Xml
Date: Mon, 27 Feb 2012 20:03:23 GMT
Server: Microsoft-IIS/7.5
Vary: Accept-Encoding
Via: 1.1 sophos1.canwest.co.nz:8080
X-AspNet-Version: 2.0.50727
X-Powered-By: ASP.NET
X-PvInfo: [S10201.C90252.A22957.RA22962.G1610A.U2D8630FA].[OT/xml.OG/pages]


 
New Post
7/30/2012 10:37 AM
 

Did you ever find a solution for this? I need to do the same for anonymous users.

 
New Post
7/30/2012 11:34 AM
 

XML is limited for security reasons to users with module edit permissions. You can combine XMl  module and formandlist datasource to deliver any custom xml based on a fnl module.

Regards,
Stefan

 
New Post
8/27/2012 5:16 PM
 

Hi Jacques 

Apologies for the delayed reply, I have been experiencing difficulties logging back into dotnetnuke.com and usability issues on retrieving my password.

The solution I came to was fairly simple in the end. I created a normal ASP.NET .aspx page and used VB code in these to get the server to output the required XML from the UserDefinedTable / FormAndList module (and I removed nodes I didn't need in the process).

The .aspx file in created would be located at  http://www.domainname.com/portals/0/External/MusicChart/MusicChartName.aspx and has the following code in it.

<%@ Page Language="VB" ContentType="text/xml" ResponseEncoding="utf-8" %>
<%--<%@ OutputCache Duration="20" VaryByParam="none" %>--%>
<%-- 20 Second output cache, disable this when debugging --%>
<%@ Import namespace="System.IO" %>
<%@ Import namespace="System.Data" %>
<%@ Import Namespace="System.Xml" %>
<%@ Import Namespace="System.Xml.Xsl" %>
<%@ Import Namespace="System.Xml.XPath" %>
<%@ Import Namespace="DotNetNuke.Entities.Users" %>
<%@ Import Namespace="DotNetNuke.Modules.UserDefinedTable" %>


<script language="vb" runat="server">


Private Sub Page_LoadComplete(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.LoadComplete

'adapted from http://www.dotnetnuke.com/Resources/Blogs/EntryId/3055/DotNetNuke-Tips-and-Tricks-25-Module-Magic-with-Form-and-List.aspx
Dim intModuleId As Integer = 5232   ' ***************CHANGE THIS TO YOUR FORMANDLIST MODULEID************
Dim intTabId As Integer = 230    ' ****************CHANGE THIS TO YOUR FORMANDLIST MODULE'S TABID**************        
Dim dsUDT = (New UserDefinedTableController(intModuleId, intTabId, New UserInfo())).GetDataSet(True)

' USE THIS FOR DEBUGGING 1 - This exports the UDT to a XML file
'Dim strOutputPath As String = Request.PhysicalApplicationPath & "Portals\0\External\MusicChart\Fat40_debug_1.xml"
'Dim xmlSW As System.IO.StreamWriter = New System.IO.StreamWriter(strOutputPath)
'dsUDT.WriteXml(xmlSW, XmlWriteMode.IgnoreSchema)
'xmlSW.Close()

' Load UserDefinedTable DataSet object into DataTable object and remove unnessary columns 
' Adapted from http://gchandra.wordpress.com/2008/01/07/aspnet-filter-datatable-by-column/
Dim dtUDT as DataTable
dtUDT = dsUDT.Tables(0).Copy
dtUDT.Columns.Remove("UserDefinedRowId")
dtUDT.Columns.Remove("Created by")
dtUDT.Columns.Remove("Created at")
dtUDT.Columns.Remove("Changed at")
dtUDT.Columns.Remove("Changed by")
dtUDT.Columns.Remove("EditLink")
dtUDT.Columns.Remove("Created by_UDT_Original")
dtUDT.Columns.Remove("Created by_UDT_Caption")
dtUDT.Columns.Remove("Created by_UDT_Url")
dtUDT.Columns.Remove("Created at_UDT_Value")
dtUDT.Columns.Remove("Created at_UDT_Ticks")
dtUDT.Columns.Remove("Changed by_UDT_Original")
dtUDT.Columns.Remove("Changed by_UDT_Caption")
dtUDT.Columns.Remove("Changed by_UDT_Url")
dtUDT.Columns.Remove("Changed at_UDT_Value")
dtUDT.Columns.Remove("Changed at_UDT_Ticks")

' USE THIS FOR DEBUGGING 2 - This exports the FILTERED UDT to a XML file
'Dim xmlSW2 As System.IO.StreamWriter = New System.IO.StreamWriter(Request.PhysicalApplicationPath & "Portals\0\Outbound\External\Fat40_debug_2.xml")
'dtUDT.WriteXml(xmlSW2, XmlWriteMode.IgnoreSchema)
' USE THIS FOR DEBUGGING 3 - This shows the FILTERED UDT as a HTML table
'dsList.DataSource = dtUDT
        'dsList.DataBind()

' Write the XML to a stringBuilder then to the screen 
' Adapted from http://www.demtron.com/blog/post/2009/02/28/Converting-DataTable-to-an-XML-String.aspx
Dim sbFilteredUserDefinedTable As New StringBuilder
Dim swFilteredUserDefinedTable As New IO.StringWriter(sbFilteredUserDefinedTable)
dtUDT.WriteXml(swFilteredUserDefinedTable, XmlWriteMode.IgnoreSchema)
Response.Write(sbFilteredUserDefinedTable.ToString())

End Sub


</script>

 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsForm and ListForm and ListShow All Data as XML when not logged in as AdministratorShow All Data as XML when not logged in as Administrator


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