简体   繁体   English

与Joomla一样构建文章/文档版本控制系统

[英]Build article/document versioning system as in Joomla

I am building a web application and my client wants be able to look at original reports that are coming to the app (reports gets eventually changed by project leaders at my clients company). 我正在构建一个Web应用程序,我的客户希望能够查看即将出现在该应用程序中的原始报告(报告最终会由我的客户公司的项目负责人更改)。 I am guessing that they will in the future want to see even more information, like every change and who did what during the process from original to final report. 我猜他们将来会希望看到更多信息,例如每次更改以及在原始报告到最终报告过程中谁做了什么。 That is why I am considering to implement versioning system for all reports, so they can track all changes back to original report. 这就是为什么我考虑对所有报告实施版本控制系统,以便他们可以将所有更改追溯到原始报告的原因。

I have been using Joomla for a long time and I like their approach to build their database, so I wonder if there is someone who is familiar with how Joomla solved this in their database. 我使用Joomla已有很长时间了,我喜欢他们构建数据库的方法,所以我想知道是否有人熟悉Joomla如何在他们的数据库中解决这个问题。 I could see that they have separate table called: ucm_history. 我可以看到它们有一个称为ucm_history的单独表。 Is it the only thing they have in database in order to track old version of articles? 这是他们在数据库中唯一可以跟踪旧版本文章的东西吗?

If somebody could help me to describe best practices of versioning, I would be very thankful, and I am sure that it would be helpful to lot of other people as I see this coming in more and more apps. 如果有人可以帮助我描述版本控制的最佳做法,我将非常感激,而且我相信这将对很多其他人有所帮助,因为我看到越来越多的应用程序中出现了这种情况。

Yes, all of the version data is slammed into that one table. 是的,所有版本数据都已放入该表中。

The sha1_hash column is quite a clever piece of data to store in my opinion because it allows a very quick assessment of what is unique (after the initial character_count check of course) without having to scan an ever-growing number of content rows that could be tens of thousands of characters each. 在我看来, sha1_hash列是一个非常聪明的数据存储,因为它可以非常快速地评估唯一性(当然,在最初的character_count检查之后),而不必扫描数量可能不断增加的内容行。每个字符数以万计。 Identifying unique content is vital in avoiding unnecessary table bloat. 标识独特的内容对于避免不必要的表格膨胀至关重要。

The most noticeable drawback with the ucm_history table ( Unified Content Model in case anyone is wondering) is that you can't easily call any meaningful queries on the content data because it is all converted to json. ucm_history表(如果有人想知道的话,使用Unified Content Model最明显的缺点是,您无法轻松地对内容数据调用任何有意义的查询,因为它们都已转换为json。

The ucm_history table is purpose-designed and the point/goal of its existence is storage ONLY. ucm_history表是专门设计的,其存在的目的/目标仅是存储的。 To processes the data, it must be pulled out entirely then have the json data parsed. 要处理数据,必须将其完全拉出,然后解析json数据。

If this is sufficient for your project, go ahead and construct your own clone of the code/db ...after all, it's open source! 如果这足以满足您的项目的需求,那么继续构建自己的代码/ db克隆...毕竟,它是开源的!

I have a few concerns about how Joomla's version popup modal works (lights on / lights off when scrolling the page while modal is presented) and the generic "Saved" message when things may not have been updated because there were no changes. 我对Joomla的版本弹出式模态如何工作(在显示模态时滚动页面时亮/灭)和通用的“已保存”消息有一些担心,该消息可能由于没有更改而未进行任何更新。 However, overall it's pretty clever stuff, worthy of emulating. 但是,总体来说,这是非常聪明的东西,值得模仿。

ps In the future, please post your Joomla questions at JoomlaStackExchange . ps将来,请在JoomlaStackExchange上发布您的Joomla问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM