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

HomeHomeUsing DNN Platf...Using DNN Platf...Using Modules a...Using Modules a...Module HistoryModule History
Previous
 
Next
New Post
9/14/2011 12:11 PM
 
I am in the process of developing some extensions for the HTML Pro module to allow my users to 1) compare revisions of a module as they change, and 2) view how a page looked on a specific point in time with the ability to print and see all the modules on the page along with the one being viewed. 

The idea is that when a user opens the Edit Content panel on the HTML Pro module there will be a couple of additional sections.  One that allows them to compare different versions of the module and another that allows them to select from a dropdown list (based on the versions in the HTMLText table) to display how the page looked on a particular day including the other modules that were on the page at the time of the change.  Currently I am able to compare revisions and display the page and the changes to the selected module being viewed as intended.

So far, I have managed to make all my controls generate dynamically so all code is in a code-behind that can be added to a class later so I am simply able to add the class to the bin and make a couple of minor changes to the edit module and module.css under the HTML DesktopModules to make everything function as intended.

The issue I have is that I cannot locate anywhere in the existing tables to obtain the history of module changes, deletions, and additions so I can display the other modules as they were and where they were on the page at the specific point in time selected.  I can add a trigger to the HTMLText table and a couple of others to capture the changes as they occur and load them into additional tables so they can be recalled via new spored procedures, but I would prefer to avoid this if the information is already available somewhere in the existing table structure.

I am trying to keep everything as clean as possible so I can submit the changes to the core team once I have them functioning as intended.

Any assistance anyone can provider would be greatly appreciated.

Thanks,
Jeff
 
New Post
9/14/2011 1:52 PM
 
as far as I remember they're stored in the htmltextlog table which has flags for state and approval as well as the itemid so it can track back to the version in the html table

Buy the new Professional DNN7: Open Source .NET CMS Platform book Amazon US
 
New Post
9/14/2011 3:40 PM
 
I can see where the versions are available for the updates to the module in the HtmlText table, but (at least in the HtmlText table I am working from) I can see modules listed in the TabModules table that are no longer in the HtmlText table so I was assuming that the missing modules were at one time added to the page, but have since been deleted from this table which means that I cannot pull those modules content while viewing historical pages. Also, looking at the StateID in the HtmlTextLog table it appears that these are being pulled from the WorkFlowStates , which does not include the Deleted items just the states from this table (unless there is somewhere else I can pull from).

I have started putting together some SQL in a Stored Procedure that could be used to pull the information from the HtmlText and TabModules tables based on the selected Module and DateTime chosen. This could either be done in a Trigger to load a snapshot table or real time if I am able to pickup everything that was on the page at the time chosen. Here is my code thus far (obviously I am capturing information I will not need to reproduce the page and it need further consideration priot to production, but this gives you an idea of what i am trying to accomplish):

Declare @ItemID int
SET @ItemID = 53
Select *
FROM [DNNDev6_JC].[dbo].[TabModules] A
LEFT OUTER JOIN [DNNDev6_JC].[dbo].[HtmlText] B
ON (A.ModuleID = B.ModuleID)
WHERE A.TabID IN (
SELECT TabID
FROM [DNNDev6_JC].[dbo].[TabModules]
WHERE ModuleID IN (
SELECT ModuleID
FROM [DNNDev6_JC].[dbo].[HtmlText]
WHERE ItemID = @ItemID
)
)
AND A.ModuleID IN (Select ModuleID FROM [DNNDev6_JC].[dbo].[HtmlText])
AND B.IsPublished = 1
AND B.ItemID IN (
Select MAX(ItemID) AS ItemID
From [DNNDev6_JC].[dbo].[HtmlText]
WHERE CreatedOnDate <= (Select LastModifiedOnDate from [DNNDev6_JC].[dbo].[HtmlText] WHERE ItemID = @ItemID)
AND IsPublished = 1
GROUP BY ModuleID
)

Any additional information you can provide concerning how I can reproduce the page would be greatly appreciated as well as any additional thoughts you have on this.

Thanks,
Jeff
 
New Post
9/14/2011 3:55 PM
 
Ignore the SQL from my last message. The statement WHERE CreatedOnDate <= (Select LastModifiedOnDate from [DNNDev6_JC].[dbo].[HtmlText] is elimintaint some needed records. I'm working on this as I'm responding which brings something else up; If I decide to load a snapshot table, is there an SP that is already in DNN to pull what is being displayed on the page as opposed to writing an additional Procedure?

Any information is appreciated.

Thanks,
Jeff
 
New Post
9/14/2011 4:09 PM
 
Ok, if your interested, this seems to be returning the results I expect:

Declare @ItemID int
SET @ItemID = 54
Select GetDate() AS [ModifyDate], A.TabID, A.ModuleID, B.ItemID, A.PaneName, A.ModuleOrder
, B.Version, B.StateID, B.Content, B.LastModifiedOnDate
, A.DisplayTitle, A. DisplayPrint, A.IsDeleted, A.Moduletitle, A.Header, A.Footer
FROM [DNNDev6_JC].[dbo].[TabModules] A
LEFT OUTER JOIN [DNNDev6_JC].[dbo].[HtmlText] B
ON (A.ModuleID = B.ModuleID)
WHERE A.TabID IN (
SELECT TabID
FROM [DNNDev6_JC].[dbo].[TabModules]
WHERE ModuleID IN (
SELECT ModuleID
FROM [DNNDev6_JC].[dbo].[HtmlText]
WHERE ItemID = @ItemID
)
)
AND A.ModuleID IN (Select ModuleID FROM [DNNDev6_JC].[dbo].[HtmlText])
AND B.IsPublished = 1
AND B.ItemID IN (
Select MAX(ItemID) AS ItemID
From [DNNDev6_JC].[dbo].[HtmlText]
WHERE IsPublished = 1
AND CreatedOnDate <= (Select LastModifiedOnDate from [DNNDev6_JC].[dbo].[HtmlText] WHERE ItemID = @ItemID)
GROUP BY ModuleID
)
 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Using Modules a...Using Modules a...Module HistoryModule History


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