Şablonunuzu Derleme

Şablonunuzu derlerken, şablondaki site için structure.json dosyasında sayfaların her biri için bir statik HTML sayfası oluşturulur.

Derleme adımı, çalıştırma zamanında bir denetleyiciye ihtiyaç duymadan hemen görüntülenen bir HTML sayfanız olması için sayfa meta verisini (örneğin 100.json) sayfa yerleşimiyle (örneğin about.html) birleştirir. Özel derleyiciler, gezinme ve bileşenler gibi önceden dinamik olan öğeleri sayfada derleyerek çalıştırma zamanı JavaScript yürütmesini daha da azaltmanıza olanak tanır.

cec compile-template komutu, sitedeki her sayfa için şu eylemleri gerçekleştirir:

  • Siteyi ve sayfa meta verisini okumak
  • Sayfa yerleşimini okumak ve sayfa yerleşimi derleyicisi uygulamak
  • Sayfadaki her yuva için:
    • Yuvayı page.json dosyasında tanımlı grid ile genişletmek
    • Yuvadaki her bileşen için:
      • Bileşen derleyicisi uygulamak
      • Oluşturulan bileşen işaretlemesini yuva içinde ilgili konuma eklemek
  • Derlenen işaretlemedeki makroları genişletmek ve Oracle Content Management işleyicisi tarafından çalıştırma zamanında kullanılan SCS JavaScript nesnesini eklemek
  • Derlenen sayfa işaretlemesini src/templates/<template>/static klasörüne kaydetmek

Sitenizi derlemek için şunu çalıştırın:

> cec compile-template BlogTemplate
Compile Template: compiling template BlogTemplate
Oracle Content Management Site Compiler

createPage: Processing pageId 100. Preview URL: 
http://localhost:8085/templates/BlogTemplate/index.html 
createPage: Processing pageId 105. Preview URL: 
http://localhost:8085/templates/BlogTemplate/post-detail.html 
createPage: Processing pageId 401. Preview URL: 
http://localhost:8085/templates/BlogTemplate/about.html 
createPage: Processing pageId 402. Preview URL: 
http://localhost:8085/templates/BlogTemplate/search.html 
createPage: Processing pageId 403. Preview URL: 
http://localhost:8085/templates/BlogTemplate/authors.html 
All page creation calls complete.

Creating detail pages: 
createPage: Processing detail pageId 105. Preview URL: 
http://localhost:8085/templates/BlogTemplate/post-detail/1481786063051-developing-content-layout- for-content-and-experience-cloud
createPage: Processing detail pageId 105. Preview URL: 
http://localhost:8085/templates/BlogTemplate/post-detail/1481786063052-dynamic-dom- manipulation-in-content-layout 
createPage: Processing detail pageId 105. Preview URL: 
http://localhost:8085/templates/BlogTemplate/post-detail/1481786063045-getting-media-url-in- the-content-layout 
createPage: Processing detail pageId 105. Preview URL: 
http://localhost:8085/templates/BlogTemplate/post-detail/1481786063053-getting-reference- items-in-content-layout 
createPage: Processing detail pageId 105. Preview URL: 
http://localhost:8085/templates/BlogTemplate/post-detail/1481786063048-navigating-to-a- search-page-with-search-query 
createPage: Processing detail pageId 105. Preview URL: 
http://localhost:8085/templates/BlogTemplate/post-detail/1481786063050-alex-read 
createPage: Processing detail pageId 105. Preview URL: 
http://localhost:8085/templates/BlogTemplate/post-detail/1481786063047-jerrold-summers 
createPage: Processing detail pageId 105. Preview URL: 
http://localhost:8085/templates/BlogTemplate/post-detail/1481786063049-kelly-emerson 
createPage: Processing detail pageId 105. Preview URL: 
http://localhost:8085/templates/BlogTemplate/post-detail/1481786063043-samantha-howard 
createPage: Processing detail pageId 105. Preview URL: 
http://localhost:8085/templates/BlogTemplate/post-detail/1481786063046-raising-triggers-from- content-layout 
createPage: Processing detail pageId 105. Preview URL: 
http://localhost:8085/templates/BlogTemplate/post-detail/1481786063044-rendering-the-content- layout-using-mustache-template 
All detail page creation calls complete.

Derleme Hataları

Derleme sırasında üç tipte mesaj alırsınız: Bilgi, Uyarı ve Hatalar.

  1. Bilgi mesajları sorunlar hakkında farkında olmanız gereken öğelerdir, ancak bu mesajlar muhtemelen derlemenin parçası olarak beklenir:
    • Yer tutucu içerik öğeleri çalıştırma zamanında görüntülenir.
    • Eksik sayfa yerleşimi derleyicileri. Sayfa yerleşimlerinde dinamik öğe olmayabilir ve bu nedenle bunlar eksikse sorun olarak görülmezler.
    • "Erişildiğinde görüntüle" işaretli öğeler; yani site geliştiricisinin bu bileşenin sayfa derlendikten sonra bile dinamik olarak çalıştırma zamanında görüntülenmesini istediği anlamına gelir.
  2. Uyarı mesajları, muhtemelen çalışan sitenin performansını etkileyecek sorunlar hakkındadır ve mümkün olduğunda düzeltilmeleri gerekir. Bu kategorideki öğeler şunlardır:
    • Eksik içerik yerleşimi veya özel bileşen derleyicileri. Bunlar olmadan bileşenler daha önce olduğu gibi sayfada dinamik olarak görüntülenir.
    • Eksik içerik yerleşimi haritaları. Muhtemelen içerik öğelerini görüntülemek için sistem içerik yerleşimi öndeğerini kullanmak istemezsiniz.
  3. Hata mesajları bir derleme hatası belirten sorunlar hakkındadır. Sayfalar mümkün olduğunda derlenmeye devam eder, ancak genel derleme bir hatayla sonlanır.
    • Bunun en olası nedeni özel derleyicilerdeki JavaScript hatalarıdır ve hataların çözülmesi gerekir.

Not:

Yinelenen mesajları azaltmak için, derleme kaç sayfada yapılıyor olursa olsun aynı mesaj derleme başına sadece bir kez görünür.

Önceki örnekte şu derleme çıkış durumu vardı:

Compilation completed with 0 errors and 3 warnings. 
to display warnings, run with --verbose (-v) option.

Derleme adımını "-v" seçeneğiyle yeniden çalıştırırsanız şu çıktıyı görürsünüz:

> cec compile-template BlogTemplate --verbose
Compile Template: compiling template BlogTemplate 
Oracle Content Management Site Compiler

createPage: Processing pageId 100. Preview URL: 
http://localhost:8085/templates/BlogTemplate/index.html 
createPage: Processing pageId 105. Preview URL: 
http://localhost:8085/templates/BlogTemplate/post-detail.html
Info: no content item specified for placeholder: a890a65c-c0fc-451b-966b-e606ca18a1f4 
component will render at runtime. 
Info: no content item specified for placeholder: c90bbc10-c9d8-4a54-8dd4-7a8251e8efbb 
component will render at runtime. 
Info: no content item specified for placeholder: f12691e1-79ab-4d1f-a8b9-3af8c638dd26 
component will render at runtime.
createPage: Processing pageId 401. Preview URL: 
http://localhost:8085/templates/BlogTemplate/about.html 
createPage: Processing pageId 402. Preview URL: 
http://localhost:8085/templates/BlogTemplate/search.html
Info: Component: "fdfd0392-e901-48f6-8044-36803c836aa1" of type "scs-contentlist" marked as 
"render on access", will not be compiled. 
Info: Component: "ba9f3711-4367-444e-ae38-71289fc10e73" of type "scs-contentlist" marked as 
"render on access", will not be compiled. 
createPage: Processing pageId 403. Preview URL: 
http://localhost:8085/templates/BlogTemplate/authors.html 
All page creation calls complete. 

Creating detail pages: 
createPage: Processing detail pageId 105. Preview URL: 
http://localhost:8085/templates/BlogTemplate/post-detail/1481786063051-developing-content- layout-for-content-and-experience-cloud 
createPage: Processing detail pageId 105. Preview URL: 
http://localhost:8085/templates/BlogTemplate/post-detail/1481786063052-dynamic-dom- manipulation-in-content-layout 
createPage: Processing detail pageId 105. Preview URL: 
http://localhost:8085/templates/BlogTemplate/post-detail/1481786063045-getting-media-url-in- the-content-layout 
createPage: Processing detail pageId 105. Preview URL: 
http://localhost:8085/templates/BlogTemplate/post-detail/1481786063053-getting-reference- items-in-content-layout 
createPage: Processing detail pageId 105. Preview URL: 
http://localhost:8085/templates/BlogTemplate/post-detail/1481786063048-navigating-to-a- search-page-with-search-query 
createPage: Processing detail pageId 105. Preview URL: 
http://localhost:8085/templates/BlogTemplate/post-detail/1481786063050-alex-read 
Warning: failed to find content layout map entry for: Starter-Blog-Author:header. Will compile 
using the system default layout.
Warning: failed to find content layout map entry for: Starter-Blog-Author:content. Will compile 
using the system default layout. 
Warning: failed to find content layout map entry for: Starter-Blog-Author:sidebar. Will compile 
using the system default layout.  
createPage: Processing detail pageId 105. Preview URL: 
http://localhost:8085/templates/BlogTemplate/post-detail/1481786063047-jerrold-summers 
createPage: Processing detail pageId 105. Preview URL: 
http://localhost:8085/templates/BlogTemplate/post-detail/1481786063049-kelly-emerson 
createPage: Processing detail pageId 105. Preview URL: 
http://localhost:8085/templates/BlogTemplate/post-detail/1481786063043-samantha-howard 
createPage: Processing detail pageId 105. 
Preview URL: http://localhost:8085/templates/BlogTemplate/post-detail/1481786063046-raising-triggers-from- content-layout 
createPage: Processing detail pageId 105. Preview URL: 
http://localhost:8085/templates/BlogTemplate/post-detail/1481786063044-rendering-the-content- layout-using-mustache-template 
All detail page creation calls complete. 

Compilation completed with 0 errors and 3 warnings. 

*** compiled template is ready to test 
*** to render non-compiled pages, remove compiled files from under: /private/tmp/cec-
src/src/templates/BlogTemplate/static

Detay Sayfası Derlemesi

Detay sayfası derlemesi, derleme sırasında karşılaştığı tüm içerik öğelerini ayırır. Daha sonra yeni detay sayfasının URL'sini tanımlamak için açıklayıcı URL değerini kullanarak bulduğu her içerik öğesi için detay sayfasını yeniden derler.

Önceki derleme çıktısı iki bölümde gerçekleşir:

  1. Sayfa Derlemesi
  2. Detay Sayfası Derlemesi

Önceki örnekte Starter-Blog-Author sayfası için hiçbir içerik yerleşimi haritası girişi olmadığına dair uyarılar göreceksiniz. Ancak biz Starter-Blog-Author için detay sayfaları istemiyoruz. Detay sayfası sadece Starter-Blog-Post içerik öğeleri içindir. Bu hataları kaldırmak üzere, ayarlarında açıkça referans gösterilen bir detay sayfası yoksa içerik öğelerini şu seçenekle detay sayfası derlemesinden hariç tutabilirsiniz:

--noDefaultDetailPageLink, -o  Do not generate compiled detail page for items/content lists
      that use the default detail page.

Yani detay sayfası öndeğerini kullanan detay sayfası oluşturma hariç tutularak derlemenin yeniden çalıştırılması şu çıktıyı üretir:

> cec compile-template BlogTemplate --noDefaultDetailPageLink 
Compile Template: compiling template BlogTemplate 
Oracle Content Management Site Compiler 

createPage: Processing pageId 100. Preview URL: 
http://localhost:8085/templates/BlogTemplate/index.html 
createPage: Processing pageId 105. Preview URL: 
http://localhost:8085/templates/BlogTemplate/post-detail.html 
createPage: Processing pageId 401. Preview URL: 
http://localhost:8085/templates/BlogTemplate/about.html 
createPage: Processing pageId 402. Preview URL: 
http://localhost:8085/templates/BlogTemplate/search.html 
createPage: Processing pageId 403. Preview URL: 
http://localhost:8085/templates/BlogTemplate/authors.html 
All page creation calls complete.

Creating detail pages: 
createPage: Processing detail pageId 105. Preview URL: 
http://localhost:8085/templates/BlogTemplate/post-detail/1481786063051-developing-content-
layout-for-content-and-experience-cloud
createPage: Processing detail pageId 105. Preview URL:
http://localhost:8085/templates/BlogTemplate/post-detail/1481786063052-dynamic-dom -manipulation-in-content-layout
createPage: Processing detail pageId 105. Preview URL: 
http://localhost:8085/templates/BlogTemplate/post-detail/1481786063045-getting-media-url-in- the-content-layout
createPage: Processing detail pageId 105. Preview URL:  
http://localhost:8085/templates/BlogTemplate/post-detail/1481786063053-getting-reference- items-in-content-layout
createPage: Processing detail pageId 105. Preview URL: 
http://localhost:8085/templates/BlogTemplate/post-detail/1481786063048-navigating-to-a- search-page-with-search-query
All detail page creation calls complete.

Compilation completed with no errors.

*** compiled template is ready to test 
*** to render non-compiled pages, remove compiled files from under: /private/tmp/cec-
src/src/templates/BlogTemplate/static

Belirli Sayfaları Derleme

Şablondaki tüm sayfaları derlemeniz gerekmez ve derlenecek sayfaları seçebilirsiniz. Bu, tüm siteyi sürekli olarak yeniden derlemek zorunda kalmak yerine hata ayıklamak veya güncellemek istediğiniz belirli sayfalarda çalışırken yararlıdır.

Belirli sayfaları derlemek için --pages (-p) seçeneğini ve ardından derlemek istediğiniz sayfa listesini kullanın.

Not:

Not: İçerik öğeleri liste referansı detay sayfalarındaki sayfalardaysa, detay sayfaları açıkça dahil edilmeseler bile derlenirler.

cec compile-template BlogTemplate --pages 401,402 
Compile Template: compiling template BlogTemplate 
Oracle Content Management Site Compiler

createPage: Processing pageId 401. Preview URL: 
http://localhost:8085/templates/BlogTemplate/about.html 
createPage: Processing pageId 402. Preview URL: 
http://localhost:8085/templates/BlogTemplate/search.html 
All page creation calls complete.

Compilation completed with no errors. 
*** compiled template is ready to test 
*** to render non-compiled pages, remove compiled files from under: /private/tmp/cec- 
src/src/templates/BlogTemplate/static