Board logo

標題: [程式編寫] 有冇人講下 cms design 架構 [打印本頁]

作者: form5     時間: 2019-11-25 11:38 PM

商用軟件有些 design architecture我覺得 好神奇,比如 CMS, Workflow 架構,最近學習 下piranha cms core 的 source code, 有冇 高手解釋下 呢類 CMS 的設計架構,或者同其他 CMS 架構的分別
作者: form5     時間: 2019-11-25 11:40 PM

食人鱼CMS

https://github.com/PiranhaCMS/piranha.core
作者: form5     時間: 2019-11-26 11:59 PM

  有 doc
http://piranhacms.org/

 對比 orchard core cms, 食人魚簡單好多,
Orchard core cms 等左两三年都未去到 stable release 
作者: form5     時間: 2019-11-27 10:25 PM

毎日自言自語時間

CMS db 同 data db 可以用吾同 connection string 分開,亦即係吾同牌子db 一起用,幾好

Piranha CMS is a lightweight, unobtrusive
睇左啲source code, 覺呢句廣告都幾岩,跟本可以當做  asp.net core 嘅起手template, 再免費送你一個lightweight 嘅 cms
作者: form5     時間: 2019-11-27 10:36 PM

食人鱼 用左Block editor , 好方便
估計今時今日大部分 cms 都用 block editor 去 edit html ,  
冇記錯Django cms 好似吾係
作者: form5     時間: 2019-11-27 10:47 PM

吾明點解main banner 之類 叫做hero ?   究竟咩料?
作者: tk24chan     時間: 2019-11-27 11:56 PM

用 wordpress 啦。攪咁多野做乜。
作者: form5     時間: 2019-11-28 07:11 AM

引用:
原帖由 tk24chan 於 2019-11-27 11:56 PM 發表

用 wordpress 啦。攪咁多野做乜。
主要想了解和學習 呢類 tools 係怎様 設計,好似 route, security, caching,module design ....
Wordpress 我吾識用 , 感覺太麻煩肋

[ 本帖最後由 form5 於 2019-11-28 07:18 AM 編輯 ]
作者: 台風中心的救星     時間: 2019-11-28 08:55 AM

https://youtu.be/F1eQk0ggy-U

咁改,👏
作者: form5     時間: 2019-11-28 10:10 PM

route is using asp.net core middleware pipeline


    public class PageMiddleware
      =>
        async Task Invoke(HttpContext context, IApi api, IApplicationService service)
           =>
              var response = await PageRouter.InvokeAsync(api, url, siteId);

                var page = await api.Pages.GetBySlugAsync<Models.PageInfo>(slug, siteId)
                        .ConfigureAwait(false);

                         =>  get route information

                            return new RouteResponse
                            {
                                PageId = page.Id,
                                Route = route,
                                QueryString = $"id={page.Id}&startpage={isStartPage.ToString().ToLower()}&piranha_handled=true",
                                IsPublished = page.Published.HasValue && page.Published.Value <= DateTime.Now,
                                CacheInfo = new HttpCacheInfo
                                {
                                    EntityTag = Utils.GenerateETag(page.Id.ToString(), lastModified),
                                    LastModified = lastModified
                                }

  



as a result, routing "/about"

 ends up with /page?id=
$"id={page.Id}&startpage={isStartPage.ToString().ToLower()}&piranha_handled=true"
作者: form5     時間: 2019-11-28 10:17 PM

引用:
原帖由 台風中心的救星 於 2019-11-28 08:55 AM 發表

https://youtu.be/F1eQk0ggy-U

咁改,👏
he'd be better to get a 3D printer
作者: 台風中心的救星     時間: 2019-11-29 01:14 PM

引用:
原帖由 form5 於 2019-11-28 10:10 PM 發表

route is using asp.net core middleware pipeline


    public class PageMiddleware
      =>
        async Task Invoke(Htt ...
PageMiddleware#invoke@params: (a)context, (b)api, (c)service
static context params:       context?->siteId
dynamic context params:     context?->url, service->slugId, api.Pages.GetBySlug(slugId)->page->page.id
api reference use:        PageRouter.InvokeAsync(api,url,siteId)-> response
cache tag:              api/page/service?->lastModified, page.id -> ETag


[ 本帖最後由 台風中心的救星 於 2019-11-29 01:22 PM 編輯 ]
作者: form5     時間: 2019-11-29 10:31 PM

引用:
原帖由 台風中心的救星 於 2019-11-29 01:14 PM 發表


PageMiddleware#invoke@params: (a)context, (b)api, (c)service
static context params:       context?->siteId
dynamic context params:     context?->url, service->slugId, api.Pages.GetBySlug(slugId)-> ...
may be, it is better to describe the page "route" in the a picture .

[ 本帖最後由 form5 於 2019-11-29 10:43 PM 編輯 ]

圖片附件: code_trace_page_route2.png (2019-11-29 10:42 PM, 397.31 KB) / 該附件被下載次數 46
https://computer.discuss.com.hk/attachment.php?aid=10578212


作者: form5     時間: 2019-11-30 01:34 AM

食人魚cms 究竟點樣做到headless ? 
作者: kormer     時間: 2019-11-30 02:19 AM

截圖麻煩啦,可以產個次序圖/類圖慢慢睇同跟跟.
作者: 有諗辦法     時間: 2019-11-30 12:35 PM

佢 CMS 個 C 係代表咩呢?官網首頁冇講嘅
作者: form5     時間: 2019-11-30 11:40 PM

引用:
原帖由 有諗辦法 於 2019-11-30 12:35 PM 發表

佢 CMS 個 C 係代表咩呢?官網首頁冇講嘅
C is Content, What is content? In its code representation, you may define content types as BlogArchive, StandardPage and TeaserPage.

     // way to build content types
     var pageTypeBuilder = new Piranha.AttributeBuilder.PageTypeBuilder(api)
           .AddType(typeof(Models.BlogArchive))
           .AddType(typeof(Models.StandardPage))
           .AddType(typeof(Models.TeaserPage))
           .Build()

Where "*Page" are derived from PageBase,,
Inside the Pages, there are Blocks, Regions,
Inside Regions, there are Fields,
And fields could be image, text, html, markdowntext ..., and yourown custom fields

Now, I'm fully understand what "C" is.

作者: form5     時間: 2019-11-30 11:59 PM

PiranhaCMS comes with interesting modular design, every project has a Module c# file and a IServiceCollections extension, this ServiceCollection will register own Module in the same project, in code

"Piranha.App.Modules.Register<Piranha.WebApi.Module>()"

圖片附件: way_to_register_module.png (2019-11-30 11:59 PM, 105.39 KB) / 該附件被下載次數 27
https://computer.discuss.com.hk/attachment.php?aid=10581969



圖片附件: module_webapi.png (2019-11-30 11:59 PM, 122.18 KB) / 該附件被下載次數 29
https://computer.discuss.com.hk/attachment.php?aid=10581970


作者: 有諗辦法     時間: 2019-12-1 09:11 AM

引用:
原帖由 form5 於 2019-11-30 11:40 PM 發表


C is Content, What is content? In its code representation, you may define content types as BlogArchive, StandardPage and TeaserPage.

     // way to build content types
     var pageTypeBuilder = ...
Content 我唔啱使,如果係 Customer 或者 Central 我有興趣
作者: form5     時間: 2019-12-3 12:23 AM

食人魚用vue,   唔知 add block 時 vue 同 c# controller 怎樣互動?
有冇人講下呢?
作者: form5     時間: 2019-12-3 10:14 PM

mmh, Piranha.Manager are the core for the block editor

圖片附件: block_select_api_from_vue.png (2019-12-3 10:14 PM, 206.89 KB) / 該附件被下載次數 26
https://computer.discuss.com.hk/attachment.php?aid=10593958


作者: form5     時間: 2019-12-25 10:19 PM

piranha cms is updated to asp.net core 3.1
作者: 台風中心的救星     時間: 2019-12-26 06:53 AM

You must talk to us, “when you are fifteen, you want to take your life.” I say, “ Well! That’s okay! For me, I knee to myself and just free to talk with you a several posts needn’t money. Just for accompanying prince 🤴 to study his own homework.” Ha! Ha! What’s a cruel in the world! I have to show you not able to make example for skk silly low level .NET. 👻👻👻

Character: Focus on Value-added Rule of Key way to worship God and benefit people as a player of life in Chinese race to make money, health, family and country in shuttle century to be a Good, Humble, Smart and Serious Guy though isn't handsome enough that try disguise this fact in cool and style under love of Skywalker and neightbour and seeking to farm true roots to grow as a tree in struggle to all evil and unfair in justice in brace of corporation, natural person, institution, firm under basic law, common law of Hong Kong in North Half of the earth in friends of Singapore, Japan, Auckland, India, China, England with religon of Christians, Taos, Buddists as Monk who know automatic technology to build and use system in IT to faciliate work and process to conduct and manage business and fund to invest on future of materialized world which is full of symbolic representation for formulating culture and habit of a human being that seem right instead of frustrating using left to gain vision in Weather and Astronomical, Fate in order to understand and grab the now, review the past with personal philosophy with able to write/talk proposition under theorem with proof and is logically to transfer signal and message to power own company and projects for accomplish tasks and construct column and row to make table, list, span, division, section, heading, paragraph, button, input, icon, images, breadcrumb, navigation, links, pages, documents, etc ... make me some content!

[ 本帖最後由 台風中心的救星 於 2019-12-26 09:40 AM 編輯 ]
作者: form5     時間: 2019-12-29 07:41 PM

原來可以做到distributed cache
作者: form5     時間: 2020-4-26 11:36 PM

吾見有Tracking user activity 嘅 Implementation




Copyright © 2003-2021 香港討論區