템플리트를 컴파일하면 템플리트 내의 사이트에 대한 structure.json
파일에 각 페이지의 정적 HTML 페이지가 생성됩니다.
컴파일 단계에서 페이지 메타데이터(예: 100.json
)를 페이지 레이아웃(예: about.html
)과 결합하므로 런타임에 컨트롤러 없이 즉시 HTML 페이지가 표시됩니다. 사용자정의 컴파일러를 통해 이전의 동적 항목(예: 탐색 및 구성요소)을 페이지로 컴파일하면 런타임 JavaScript 실행을 더 줄일 수 있습니다.
cec compile-template
명령은 사이트의 각 페이지에 대해 다음 동작을 수행합니다.
page.json
파일에 정의된 그리드로 슬롯 확장src/templates/<template>/static
폴더 아래에 저장사이트를 컴파일하려면 다음을 실행합니다.
> 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.
컴파일 동안 정보, 경고, 오류라는 세 가지 유형의 메시지를 받습니다.
주:
반복 메시지를 줄이기 위해 여러 페이지에 발생하든 관계없이 동일 메시지가 컴파일당 한번만 나타납니다.
앞의 예제에는 다음과 같은 컴파일 종료 상태가 있습니다.
Compilation completed with 0 errors and 3 warnings. to display warnings, run with --verbose (-v) option.
"-v" 옵션과 함께 컴파일 단계를 재실행하면 다음 출력이 표시됩니다.
> 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
세부정보 페이지 컴파일은 컴파일 중에 발생한 모든 콘텐츠 항목을 조합합니다. 그런 다음 새 세부정보 페이지의 URL을 정의하는 슬러그 값을 사용하여 발견한 각 콘텐츠 항목의 세부정보 페이지를 재컴파일합니다.
앞의 컴파일 출력은 다음 두 섹션에 나타납니다.
앞의 예제에서 Starter-Blog-Author 페이지에 대한 콘텐츠 레이아웃 맵 항목이 없다는 경고가 표시됩니다. 그러나 Starter-Blog-Author에 대한 세부정보 페이지는 원하지 않습니다. 세부정보 페이지는 Starter-Blog-Post 콘텐츠 항목에만 필요합니다. 이 오류를 제거하기 위해 해당 설정에서 참조된 명시적 세부정보 페이지가 없는 경우, 다음 옵션으로 세부정보 페이지 컴파일에서 콘텐츠 항목을 제외할 수 있습니다.
--noDefaultDetailPageLink, -o Do not generate compiled detail page for items/content lists that use the default detail page.
따라서 기본 세부정보 페이지를 사용하는 세부정보 페이지 생성을 제외하고 컴파일을 재실행하면 다음 출력이 생성됩니다.
> 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
템플리트의 모든 페이지를 컴파일할 필요는 없으며 컴파일할 페이지를 선택할 수 있습니다. 이는 전체 사이트를 계속해서 재컴파일하지 않고 특정 페이지를 디버그하거나 업데이트하려는 경우 유용합니다.
특정 페이지를 컴파일하려면 --pages (-p)
옵션 뒤에 컴파일할 페이지 목록을 사용합니다.
주:
참고: 목록 참조 세부정보 페이지에 콘텐츠 항목이 있는 경우 명시적으로 포함하지 않더라도 세부정보 페이지도 컴파일됩니다.
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