@@ -22,6 +22,7 @@ import Script from "next/script";
2222import { getSecurityIssues } from "@/services/docs/getSecurityIssues/getSecurityIssues" ;
2323import Deprecations from "@/components/deprecations/Deprecations" ;
2424import getDeprecations from "@/services/docs/getDeprecations/getDeprecations" ;
25+ import { JavadocEmbeddedDocs } from "@/components/javadocs/JavadocEmbeddedDocs" ;
2526
2627/**
2728 * Process slug consistently across all functions
@@ -237,72 +238,76 @@ export default async function Home({ searchParams, params }) {
237238
238239 if ( ! pageData || ! pageData . pageAsset ) {
239240 notFound ( ) ;
240- return null ; // Unreachable, but ensures code path terminates
241+ return null ;
241242 }
242243
243244 const { pageAsset } = pageData ;
244-
245+
245246 const sideNav = await getSideNav ( ) ;
246- const navSections = await getNavSections ( { path : '/docs/nav' , depth : 4 , languageId : 1 , ttlSeconds : 600 } ) ;
247-
248- // Check if urlContentMap exists
247+ const navSections = await getNavSections ( {
248+ path : "/docs/nav" ,
249+ depth : 4 ,
250+ languageId : 1 ,
251+ ttlSeconds : 600 ,
252+ } ) ;
253+
249254 if ( ! pageAsset ?. urlContentMap ?. inode ) {
250255 notFound ( ) ;
251256 }
252-
253- // Handle GitHub docs if needed (this sets githubSource flag)
257+
254258 if ( isGitHubDoc ( slug ) ) {
255259 const githubConfig = getGitHubConfig ( slug ) ;
256-
260+
257261 if ( githubConfig && pageAsset ?. urlContentMap ?. inode ) {
258262 const contentResult = await getDocsContentWithGitHub (
259263 slug ,
260264 githubConfig ,
261- ( ) => pageAsset ?. urlContentMap ?. _map ?. documentation || ''
265+ ( ) => pageAsset ?. urlContentMap ?. _map ?. documentation || ""
262266 ) ;
263267
264- if ( contentResult . source === ' github' ) {
268+ if ( contentResult . source === " github" ) {
265269 if ( ! pageAsset . urlContentMap . _map ) {
266270 pageAsset . urlContentMap . _map = { } ;
267271 }
268-
269- pageAsset . urlContentMap . _map . documentation = contentResult . content ;
272+
273+ pageAsset . urlContentMap . _map . documentation =
274+ contentResult . content ;
270275 pageAsset . urlContentMap . _map . githubSource = true ;
271- pageAsset . urlContentMap . _map . githubConfig = contentResult . config ;
276+ pageAsset . urlContentMap . _map . githubConfig =
277+ contentResult . config ;
272278 }
273279 }
274280 }
275-
276- // Fetch all deprecations once (GraphQL response cached ~15m by default)
281+
277282 let allDeprecations = null ;
278283 try {
279284 allDeprecations = await getDeprecations ( ) ;
280- } catch ( e ) {
285+ } catch ( e ) {
281286 console . error ( "Error fetching deprecations:" , e ) ;
282287 allDeprecations = null ;
283288 }
284289
285- // Find matching deprecation for this specific page (OR logic - always check)
286290 let deprecationForPage = null ;
287291 if ( allDeprecations && Array . isArray ( allDeprecations ) ) {
288- deprecationForPage = allDeprecations . find ( dep =>
289- dep . docLinks &&
290- Array . isArray ( dep . docLinks ) &&
291- dep . docLinks . some ( link => link . urlTitle === slug )
292- ) || null ;
292+ deprecationForPage =
293+ allDeprecations . find (
294+ ( dep ) =>
295+ dep . docLinks &&
296+ Array . isArray ( dep . docLinks ) &&
297+ dep . docLinks . some ( ( link ) => link . urlTitle === slug )
298+ ) || null ;
293299 }
294300
295301 const data = {
296302 contentlet : pageAsset . urlContentMap ,
297- sideNav : sideNav ,
303+ sideNav,
298304 currentPath : slug ,
299305 searchParams : finalSearchParams ,
300306 deprecation : deprecationForPage ,
301- allDeprecations : slug === ' deprecations' ? allDeprecations : undefined
302- }
307+ allDeprecations : slug === " deprecations" ? allDeprecations : undefined ,
308+ } ;
303309
304- // Add more path-component mappings here as needed:
305- // "path-name": (contentlet) => <ComponentName contentlet={contentlet} />,
310+ // Add more path-component mappings here as needed.
306311 const componentMap = {
307312 "changelogs" : ( data ) => < ChangeLogList { ...data } slug = { slug } /> ,
308313 "current-releases" : ( data ) => < CurrentReleases { ...data } slug = { slug } /> ,
@@ -312,6 +317,14 @@ export default async function Home({ searchParams, params }) {
312317 "deprecations" : ( data ) => < Deprecations { ...data } slug = { slug } initialItems = { data . allDeprecations || [ ] } /> ,
313318 "rest-api-sampler" : ( data ) => < RestApiPlayground { ...data } slug = { slug } /> ,
314319 "all-rest-apis" : ( data ) => < SwaggerUIComponent { ...data } slug = { slug } /> ,
320+ "javadocs" : ( data ) => (
321+ < JavadocEmbeddedDocs
322+ contentlet = { data . contentlet }
323+ sideNav = { data . sideNav }
324+ slug = { slug }
325+ searchParams = { data . searchParams }
326+ />
327+ ) ,
315328 default : ( data ) => {
316329 // Check if this is GitHub-sourced content
317330 // githubSource is set on urlContentMap._map, so check _map property
@@ -325,7 +338,7 @@ export default async function Home({ searchParams, params }) {
325338
326339 return (
327340 < div className = "flex flex-col min-h-screen" >
328- < Header sideNavItems = { sideNav [ 0 ] ?. dotcmsdocumentationchildren || [ ] } currentPath = { slug } navSections = { navSections } />
341+ < Header sideNavItems = { data . sideNav [ 0 ] ?. dotcmsdocumentationchildren || [ ] } currentPath = { slug } navSections = { navSections } />
329342 < JsonLd pageData = { data } path = { path } hostname = { hostname } />
330343
331344 < div className = "flex-1" >
0 commit comments