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 ForumsXMLXMLHow to Create a consumable XML Document from DNN Based DataHow to Create a consumable XML Document from DNN Based Data
Previous
 
Next
New Post
4/3/2008 10:23 AM
 

I've played around with ourputting information from xmod with a good deal of success.
There are a couple of modules out there taht would allow you to produc an xml document using T-SQL through database access and the For XML statement.

Xmod only store the form itself in xml form the actually data is stored in the database in value pair groups over 5 tables for size optimisation. XMod combine the dtafrom these diverse location in the programatic logic rather than the database. However, I have a snippet of SQL that will retrieve the value for a given form and xMOD id(record) also it will return addition inforamtion such as user created /modified as well as dates.

/****** Object: StoredProcedure [dbo].[getXMODRecordNText]    Script Date: 04/03/2008 15:19:23 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
 
CREATE PROCEDURE [dbo].[getXMODRecordNText]
       @formID int
       ,@record int
AS
 
DECLARE @sql NVARCHAR(40)
 
CREATE TABLE #datevalues
(
      UserDefinedRowID int NOT NULL
      ,FieldTitle varchar(255) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL DEFAULT 'CreatedAt'
      ,FieldValue nvarchar(2000) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL
)
 
CREATE TABLE #alltogether
(
      FieldTitle varchar(255) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL DEFAULT 'CreatedAt'
      ,FieldValue ntext COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL
)
 
--DROP TABLE #createdtemp
 
INSERT INTO #datevalues
   SELECT XModId AS UserDefinedRowID,'CreatedAt', DateAdded AS FieldValue
FROM         KB_XMod_Modules
WHERE     (FormId = @formID)
 
INSERT INTO #datevalues
   SELECT XModId AS UserDefinedRowID,'CreatedBy', AddUser AS FieldValue
FROM         KB_XMod_Modules
WHERE     (FormId = @formID)
 
INSERT INTO #datevalues
   SELECT XModId AS UserDefinedRowID,'ChangedAt', DateModified AS FieldValue
FROM         KB_XMod_Modules
WHERE     (FormId = @formID)
 
INSERT INTO #datevalues
   SELECT XModId AS UserDefinedRowID,'ChangedBy', UpdateUser AS FieldValue
FROM         KB_XMod_Modules
WHERE     (FormId = @formID)
 
INSERT INTO #alltogether
SELECT FieldTitle AS FieldTitle, FieldValue AS FieldValue
FROM #datevalues
Where UserDefinedRowId = @record
 
INSERT INTO #alltogether
SELECT     dbo.KB_XMod_Index_VC50.[key] AS FieldTitle, dbo.KB_XMod_Index_VC50.value AS FieldValue
FROM         dbo.KB_XMod_Index_VC50 JOIN
                      dbo.KB_XMod_Modules ON
                      dbo.KB_XMod_Index_VC50.XmodID = dbo.KB_XMod_Modules.XModId
WHERE     (dbo.KB_XMod_Modules.FormId = @formID) AND dbo.KB_XMod_Index_VC50.XmodID = @record
--UNION
INSERT INTO #alltogether
SELECT       dbo.KB_XMod_Index_VC100.[key] AS FieldTitle, dbo.KB_XMod_Index_VC100.value AS FieldValue
FROM      dbo.KB_XMod_Index_VC100 JOIN
                      dbo.KB_XMod_Modules ON dbo.KB_XMod_Modules.XModId = dbo.KB_XMod_Index_VC100.XmodID
WHERE     (dbo.KB_XMod_Modules.FormId = @formID) AND dbo.KB_XMod_Index_VC100.XmodID = @record
--UNION
INSERT INTO #alltogether
SELECT       dbo.KB_XMod_Index_VC400.[key] AS FieldTitle, dbo.KB_XMod_Index_VC400.value AS FieldValue
FROM      dbo.KB_XMod_Index_VC400 JOIN
                      dbo.KB_XMod_Modules ON dbo.KB_XMod_Modules.XModId = dbo.KB_XMod_Index_VC400.XmodID
WHERE     (dbo.KB_XMod_Modules.FormId = @formID) AND dbo.KB_XMod_Index_VC400.XmodID = @record
--UNION
INSERT INTO #alltogether
SELECT       dbo.KB_XMod_Index_VC2000.[key] AS FieldTitle, dbo.KB_XMod_Index_VC2000.value AS FieldValue
FROM      dbo.KB_XMod_Index_VC2000 JOIN
                      dbo.KB_XMod_Modules ON dbo.KB_XMod_Modules.XModId = dbo.KB_XMod_Index_VC2000.XmodID
WHERE     (dbo.KB_XMod_Modules.FormId = @formID) AND dbo.KB_XMod_Index_VC2000.XmodID = @record
--UNION
INSERT INTO #alltogether
SELECT     dbo.KB_XMod_Index_NText.[key] AS FieldTitle, dbo.KB_XMod_Index_NText.value AS FieldValue
FROM         dbo.KB_XMod_Index_NText JOIN
                      dbo.KB_XMod_Modules ON
                      dbo.KB_XMod_Index_NText.XmodID = dbo.KB_XMod_Modules.XModId
WHERE     (dbo.KB_XMod_Modules.FormId = @formID) AND dbo.KB_XMod_Index_NText.XmodID = @record
 

SELECT FieldTitle, FieldValue From #alltogether

GO

Using this I have been able to feed a single record into a formatted word document I hope this helps

John


John Nicholson
 
New Post
4/3/2008 11:12 AM
 

Well, SQL integration is overdue. In fact, it is already checked in into source repository months ago, and I am already dog fooding it on my sites.However there are some other constraints that needs to be handled before a public release is possible. Currently I don't have the time working on XML module, as I am working on a big new UDT release.

However I am always looking for help, so if you want to volunteer and join the team, please send me an email.

 
New Post
4/3/2008 11:32 AM
 

John wrote

There are a couple of modules out there taht would allow you to produc an xml document using T-SQL through database access and the For XML statement.

 

One such free module is XMLdb from www.tressleworks.ca    /Paul.

 
New Post
4/4/2008 8:31 AM
 

Stefan,

I appreciate there are time constraints, and thank you for your help so far.

In terms of 'joining the team' of course I'm willing, but I'm not a module developer, so I can contribute  little at that level.

At this stage I see two practical options :

(1)  Use the tresselworks.ca XMLdb module, which does what I want but does it on an olde version of XML/XSL module, so many of the features added in 'XSL Transformation' are absent

(2)  Somehow ( perhaps by joining the team ?) get access to the version you have in hand.  I can see a preview snapshot in this forum post and it does what I want

Either option leaves me exposing the local DB name and object qualifier to Portal Admins in order to allow Portal Admins set their own transformation, so they are equal in that respect.  The first option is easy and immediately accessible, the second is more functional, but not currently accessible - to someone like me it is 'FutureWare' .

So, can Option 2 be made more accessible in the short term?  Alternatively I'll proceed with the tresselworks module and revert to this forum when the new version is available.

Michael

 
New Post
4/4/2008 2:19 PM
 

Thanks John, that got me started.  It works - clearly one has to do a 'data aware' procedure to make the result more meaningful, but straight off this procedure got my data out as XML.  Mind you the XML won't win any prizes, but it'll work.

Michael

 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsXMLXMLHow to Create a consumable XML Document from DNN Based DataHow to Create a consumable XML Document from DNN Based Data


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