Revision of Hong Kong Economic Journal Forum revamp from Sun, 2013-06-23 02:42

It has been a while since my last post on this blog
Since we just have this project finished, and slowing moving to maintenance mode
This will be a great time to write something about the porject, before I forget everything

This project's design starting since March 2013, and of course use Drupal7
Content structure is not very complex, frontpage, article detail page, user page and "featured users" page
But as this site accept user generated content, the node edit form also need to be customized and use custom theme
And that form had been simplified for a non-trained user to use

Responsive web design is used on this site
So mobile users will serve a simpler version of the page
But we implemented by a js based responsive, which performance is not very good
There are loading time and executing time lag problems
May be we can share more on this topic later

There is something special about the frontpage, it is categorized by date
The editors and "featured bloggers" will appear on top of the page
and other general users will appear on the bottom part
Unless special circumes, frontpage only shows today's posts
and yesterday's post will be moved to dated page, navigate using the dropdown
And we have created a few views arguments to process this special, "time dependent" page setup
date based frontpage

There are 3 main difficult area on this site: article editorial, data migration and user single sign on

Article editorial
As a normal user can also create article like editors did,
editors need much more authority over the control of the article, and orderings
Everyday there are upper and lower part ordering, and will act accordingly upon special time sensitive events
Second is "admin delete", "author delete" functions
When editor found a off topic, personal attack of a potential danger article, they will hide them
but the creator need to see them marked as deleted, and keep the evidence
The article's original author can do the same to the comments under his article
So the result is we cannot use the "unpublished" state to control these
And we used bunch of flags and draggable views to implement those functions
Flag module provide a reliable API to customize the actions after content flagged
The "report" function is also an extension of flag module
By combining with rules, emails alert can be send to editors

Data migration
這個論壇是一個 revamp ,論壇原有的文章可以追溯到零八年
零八年至今五年的使用者,發表的文章,回應等等資料的數量超過一百二十萬
而資料轉移的工作其間必須下線,直到資料轉移的過程完美的完成才可以上線
最後資料由舊系統匯出,匯入到新系統總共使用了九個小時
由黄昏六時開始,一直到第二日的淩晨三時完成
為了確保轉移的工作不會在最後一刻的淩晨出現錯誤
我們花了大量的時間開發了一個基於 migrate 的 module
透過一個可維護的,持續的,可反覆匯入的方法
將舊的系統中的資料過渡到 Drupal,並對應 Drupal 中的各種主要 entity, node, comment, user, files 等等
其中的代碼開發秘密,我會在 Drupal camp taipei 2013 詳細講解 http://2013.drupalcamp.tw/session/83

使用者 single sign on
最後是使用者的單一登入
舊有的系統因為是使用同一組伺服器,只需要登入一次便可以
同一登入的習慣在兩個不同的伺服器和 sub domain 之下有完全不同的難度
為此我們也客製了整合使用者的模組
令使用者不會發覺論壇和新聞是完全兩個不同的伺服器
其中的代碼我們也會在 Drupal camp taipei 2013 詳細講解
我回來之後才將 ppt 放在這裡

最後,當然是讓大家看看 screencap
還有,未報名 Drupal Camp Taipei 2013 的立即到 http://2013.drupalcamp.tw/ 注冊參加!

Snapshot: 
Google