{"id":13612074,"url":"https://github.com/adminfaces/admin-template","last_synced_at":"2025-04-05T00:10:22.795Z","repository":{"id":37979791,"uuid":"78338732","full_name":"adminfaces/admin-template","owner":"adminfaces","description":"JSF responsive admin template based on Bootstrap and AdminLTE ","archived":false,"fork":false,"pushed_at":"2023-05-07T12:16:07.000Z","size":1310,"stargazers_count":212,"open_issues_count":11,"forks_count":100,"subscribers_count":18,"default_branch":"master","last_synced_at":"2025-03-28T23:08:27.109Z","etag":null,"topics":["adminlte","bootstrap3","jsf","material-design","responsive"],"latest_commit_sha":null,"homepage":"https://adminfaces.github.io/docs/latest/#admin_template","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/adminfaces.png","metadata":{"files":{"readme":"README.adoc","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2017-01-08T11:29:05.000Z","updated_at":"2024-10-16T10:49:09.000Z","dependencies_parsed_at":"2024-01-16T23:26:53.881Z","dependency_job_id":"3b753502-2193-4f51-88ba-932f353a0f44","html_url":"https://github.com/adminfaces/admin-template","commit_stats":null,"previous_names":[],"tags_count":37,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adminfaces%2Fadmin-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adminfaces%2Fadmin-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adminfaces%2Fadmin-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adminfaces%2Fadmin-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adminfaces","download_url":"https://codeload.github.com/adminfaces/admin-template/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247266565,"owners_count":20910836,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["adminlte","bootstrap3","jsf","material-design","responsive"],"created_at":"2024-08-01T20:00:22.110Z","updated_at":"2025-04-05T00:10:22.776Z","avatar_url":"https://github.com/adminfaces.png","language":"Java","readme":"= Admin Template\n:page-layout: base\n:source-language: java\n:icons: font\n:linkattrs:\n:sectanchors:\n:sectlink:\n:numbered:\n:doctype: book\n:toc: preamble\n:tip-caption: :bulb:\n:note-caption: :information_source:\n:important-caption: :heavy_exclamation_mark:\n:caution-caption: :fire:\n:warning-caption: :warning:\n\n[quote]\n____\nThe `admin` of JSF templates!\n____\n\nimage:https://github.com/adminfaces/admin-template/actions/workflows/ci.yml/badge.svg[Build Status, link=https://github.com/adminfaces/admin-template/actions/workflows/ci.yml]\nimage:https://img.shields.io/maven-central/v/com.github.adminfaces/admin-template.svg?label=Maven%20Central[\"Maven Central\",link=\"https://search.maven.org/search?q=g:com.github.adminfaces%20AND%20a:admin-template\"]\nimage:https://badges.gitter.im/Join%20Chat.svg[link=\"https://gitter.im/adminfaces?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge\"]\n\nA https://javaserverfaces.java.net/[JSF^] *fully responsive* `admin template` based on http://primefaces.org/themes[Primefaces^], https://almsaeedstudio.com/themes/AdminLTE/index2.html[Admin LTE^] and http://getbootstrap.com[Bootstrap^].\n\n\n== Features\n\nBelow is a non exhaustive list of notable features brought out of the box by this template:\n\n* Fully *responsive*\n** Its based on Bootstrap and AdminLTE two well tested and solid frameworks\n* Enhanced mobile experience\n** Material design load bar\n** Material design http://admin-showcase-admin-showcase.7e14.starter-us-west-2.openshiftapps.com/showcase/pages/components/buttons.xhtml?material=true[flat buttons^]\n** Ripple effect based on http://materializecss.com/waves.html[materialize css^] +\nimage:https://user-images.githubusercontent.com/1592273/27104868-d9bfb33e-5063-11e7-83be-2201a3f8cda5.gif[]\n** Touch enabled menu to slide in/out and show navbar on scroll up +\nimage:https://cloud.githubusercontent.com/assets/1592273/25071807/dd37121e-2296-11e7-855c-8f20b59dcf5f.gif[]\n** Auto show and hide navbar based on page scroll\n** Scroll to top\n* Automatically activates (highlight) menu based on current page +\nimage:https://github.com/adminfaces/admin-docs/raw/master/src/docs/images/menu-highlight.png[link=\"https://github.com/adminfaces/admin-docs/blob/master/src/docs/images/menu-highlight.png?raw=true\"]\n* Custom \u003c\u003cError Pages, error pages\u003e\u003e\n* Two menu modes, left and horizontal based menu\n* Configurable, see \u003c\u003cConfiguration\u003e\u003e\n* http://admin-showcase-admin-showcase.7e14.starter-us-west-2.openshiftapps.com/showcase/pages/layout/breadcrumb.xhtml[Breadcrumb^] based navigation\n* Layout customization via \u003c\u003cControl Sidebar\u003e\u003e\n* High resolution and responsible icons based on Glyphycons and FontAwesome\n* Menu items search +\nimage:https://github.com/adminfaces/admin-docs/raw/master/src/docs/images/menu-search.png[link=\"https://github.com/adminfaces/admin-docs/blob/master/src/docs/images/menu-search.png?raw=true\"]\n* Builtin `dark` and `light` skins\n* Back to previous screen when logging in again after session expiration (or accessing a page via url without being logged in)\n\nNOTE: Most of the above features can be enabled/disabled via \u003c\u003cConfiguration,configuration\u003e\u003e mechanism.\n\n== Usage\n\nFirst include it in your classpath:\n\n\n----\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.github.adminfaces\u003c/groupId\u003e\n    \u003cartifactId\u003eadmin-template\u003c/artifactId\u003e\n    \u003cversion\u003eversion\u003c/version\u003e\n\u003c/dependency\u003e\n----\n\n[WARNING]\n====\nAdmin template will bring the following transitive dependencies:\n\n----\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.github.adminfaces\u003c/groupId\u003e\n    \u003cartifactId\u003eadmin-theme\u003c/artifactId\u003e\n    \u003cversion\u003eversion\u003c/version\u003e\n\u003c/dependency\u003e\n\u003cdependency\u003e\n    \u003cgroupId\u003eorg.primefaces\u003c/groupId\u003e\n    \u003cartifactId\u003eprimefaces\u003c/artifactId\u003e\n    \u003cversion\u003e12.0\u003c/version\u003e\n\u003c/dependency\u003e\n\n\u003cdependency\u003e\n    \u003cgroupId\u003eorg.omnifaces\u003c/groupId\u003e\n    \u003cartifactId\u003eomnifaces\u003c/artifactId\u003e\n    \u003cversion\u003e4.1\u003c/version\u003e\n\u003c/dependency\u003e\n----\n\nWhich you can override in your pom.xml as needed.\n====\n\n\nWith the template dependency in classpath now you can use `admin` facelets template into your JSF pages.\n\n=== Example\n\nConsider the following sample page:\n\n[source,html]\n----\n\u003c?xml version=\"1.0\" encoding=\"UTF-8\"?\u003e\n\u003cui:composition xmlns=\"http://www.w3.org/1999/xhtml\"\n                xmlns:ui=\"jakarta.faces.facelets\"\n                xmlns:p=\"http://primefaces.org/ui\"\n                template=\"/admin.xhtml\"\u003e \u003c1\u003e\n\n    \u003cui:define name=\"head\"\u003e\n        \u003ctitle\u003eAdmin Starter\u003c/title\u003e\n    \u003c/ui:define\u003e\n\n    \u003cui:define name=\"logo-lg\"\u003e\n        Admin Starter\n    \u003c/ui:define\u003e\n\n    \u003cui:define name=\"logo-mini\"\u003e\n        Admin\n    \u003c/ui:define\u003e\n\n    \u003cui:define name=\"menu\"\u003e\n        \u003cul class=\"sidebar-menu\"\u003e\n            \u003cli\u003e\n                \u003cp:link href=\"/index.xhtml\" onclick=\"clearBreadCrumbs()\"\u003e\n                    \u003ci class=\"fa fa-home\"\u003e\u003c/i\u003e\n                    \u003cspan\u003eHome\u003c/span\u003e\n                \u003c/p:link\u003e\n            \u003c/li\u003e\n\t        \u003cli class=\"header\"\u003e\n\t            General\n\t        \u003c/li\u003e\n\t        \u003cli\u003e\n\t            \u003cp:link href=\"/car-list.xhtml\"\u003e\n\t                \u003ci class=\"fa fa-car\"\u003e\u003c/i\u003e\n\t                \u003cspan\u003eCars\u003c/span\u003e\n\t            \u003c/p:link\u003e\n\t        \u003c/li\u003e\n        \u003c/ul\u003e\n     \u003c/ui:define\u003e\n\n    \u003cui:define name=\"top-menu\"\u003e\n        \u003cui:include src=\"/includes/top-bar.xhtml\"/\u003e\n    \u003c/ui:define\u003e\n\n      \u003cui:define name=\"title\"\u003e\n        \u003ch2 class=\"align-center\"\u003e\n            Welcome to the \u003cspan class=\"text-aqua\"\u003e \u003ci\u003e\u003ca href=\"https://github.com/adminfaces/admin-starter\" target=\"_blank\"\n                                                          style=\"text-transform: none;text-decoration: none\"\u003e AdminFaces Starter\u003c/a\u003e\u003c/i\u003e\u003c/span\u003e Project!\n            \u003cbr/\u003e\n            \u003csmall\u003eIntegrating \u003cp:link value=\"Primefaces\" href=\"http://primefaces.org\"/\u003e, \u003cp:link value=\"Bootstrap\"\n                                                                                                  href=\"http://getbootstrap.com/\"/\u003e and\n                \u003cp:link value=\"Admin LTE\" href=\"https://almsaeedstudio.com/themes/AdminLTE/index2.html/\"/\u003e into your\n                \u003cp:link value=\"JSF\" href=\"https://javaserverfaces.java.net/\"/\u003e application.\n            \u003c/small\u003e\n        \u003c/h2\u003e\n    \u003c/ui:define\u003e\n\n    \u003cui:define name=\"description\"\u003e\n        A page description\n    \u003c/ui:define\u003e\n\n    \u003cui:define name=\"body\"\u003e\n    \t\u003ch2\u003ePage body\u003c/h2\u003e\n    \u003c/ui:define\u003e\n\n\n    \u003cui:define name=\"footer\"\u003e\n          \u003ca target=\"_blank\"\n           href=\"https://github.com/adminfaces/\"\u003e\n            Copyright (C) 2017 - AdminFaces\n        \u003c/a\u003e\n\n        \u003cdiv class=\"pull-right hidden-xs\" style=\"color: gray\"\u003e\n            \u003ci\u003e1.0.0\u003c/i\u003e\n        \u003c/div\u003e\n    \u003c/ui:define\u003e\n\n\n\u003c/ui:composition\u003e\n----\n\u003c1\u003e /admin.xhtml is the location of the template\n\nThe above page definition renders as follows:\n\nimage:template-example.png[]\n\nThere are also other regions defined in admin.xhtml template, https://github.com/adminfaces/admin-template/blob/master/src/main/resources/META-INF/resources/admin.xhtml[see here^].\n\n[TIP]\n====\nA good practice is to define a template on your application which extends the admin template, see https://github.com/adminfaces/admin-starter/blob/master/src/main/webapp/WEB-INF/templates/template.xhtml[admin-starter application template here^].\n\nSo in your pages you use your template instead of admin.\n====\n\n== Application template\n\nInstead of repeating sections like *menu*, *logo*, *head* and *footer* on every page we can create a template inside our application which uses `admin.xhtml` as template:\n\n./WEB-INF/templates/template.xhtml\n[source,html]\n----\n\u003c?xml version=\"1.0\" encoding=\"UTF-8\"?\u003e\n\u003cui:composition xmlns=\"http://www.w3.org/1999/xhtml\"\n                xmlns:ui=\"jakarta.faces.facelets\"\n                xmlns:p=\"http://primefaces.org/ui\"\n                template=\"/admin.xhtml\"\u003e\n\n    \u003cui:define name=\"head\"\u003e\n            \u003ctitle\u003eAdmin Starter\u003c/title\u003e\n            \u003ch:outputStylesheet library=\"css\" name=\"starter.css\"/\u003e\n    \u003c/ui:define\u003e\n\n    \u003cui:define name=\"logo-lg\"\u003e\n        Admin Starter\n    \u003c/ui:define\u003e\n\n    \u003cui:define name=\"logo-mini\"\u003e\n        Admin\n    \u003c/ui:define\u003e\n\n    \u003cui:define name=\"menu\"\u003e\n        \u003cul class=\"sidebar-menu\"\u003e\n            \u003cli\u003e\n                \u003cp:link href=\"/index.xhtml\" onclick=\"clearBreadCrumbs()\"\u003e\n                    \u003ci class=\"fa fa-home\"\u003e\u003c/i\u003e\n                    \u003cspan\u003eHome\u003c/span\u003e\n                \u003c/p:link\u003e\n            \u003c/li\u003e\n\t        \u003cli class=\"header\"\u003e\n\t            General\n\t        \u003c/li\u003e\n\t        \u003cli\u003e\n\t            \u003cp:link href=\"/car-list.xhtml\"\u003e\n\t                \u003ci class=\"fa fa-car\"\u003e\u003c/i\u003e\n\t                \u003cspan\u003eCars\u003c/span\u003e\n\t            \u003c/p:link\u003e\n\t        \u003c/li\u003e\n        \u003c/ul\u003e\n     \u003c/ui:define\u003e\n\n    \u003cui:define name=\"top-menu\"\u003e\n        \u003cui:include src=\"/includes/top-bar.xhtml\"/\u003e\n    \u003c/ui:define\u003e\n\n    \u003cui:define name=\"footer\"\u003e\n        \u003ca target=\"_blank\"\n           href=\"https://github.com/adminfaces/\"\u003e\n            Copyright (C) 2017 - AdminFaces\n        \u003c/a\u003e\n\n        \u003cdiv class=\"pull-right hidden-xs\" style=\"color: gray\"\u003e\n            \u003ci\u003e1.0.0\u003c/i\u003e\n        \u003c/div\u003e\n    \u003c/ui:define\u003e\n\n\u003c/ui:composition\u003e\n----\n\nAnd now the page can just define its content and title:\n\n./webapp/mypage.xhtml\n[source,xml]\n----\n\u003c?xml version=\"1.0\" encoding=\"UTF-8\"?\u003e\n\u003cui:composition xmlns=\"http://www.w3.org/1999/xhtml\"\n                xmlns:ui=\"jakarta.faces.facelets\"\n                template=\"/WEB-INF/templates/template.xhtml\"\u003e\n\n    \u003cui:define name=\"title\"\u003e\n        A page title\n    \u003c/ui:define\u003e\n\n    \u003cui:define name=\"description\"\u003e\n        A page description\n    \u003c/ui:define\u003e\n\n    \u003cui:define name=\"body\"\u003e\n    \t\u003ch2\u003ePage body\u003c/h2\u003e\n    \u003c/ui:define\u003e\n\n\u003c/ui:composition\u003e\n----\n\n=== Switching between *left menu* and *top menu* templates\n\nAdminFaces supports two layout modes, one is *left based menu* and the other is *top based menu*.\n\nThe user can change layout modes via \u003c\u003cControl Sidebar, control sidebar\u003e\u003e but to make it work you have to use *LayoutMB* to define page template:\n\n./webapp/mypage.xhtml\n[source,xml]\n----\n\u003c?xml version=\"1.0\" encoding=\"UTF-8\"?\u003e\n\u003cui:composition xmlns=\"http://www.w3.org/1999/xhtml\"\n                xmlns:ui=\"jakarta.faces.facelets\"\n                template=\"#{layoutMB.template}\"\u003e\n\n\u003c!-- page content --\u003e\n\n\u003c/ui:composition\u003e\n----\n\nAs a *convention over configuration* LayoutMB will load templates from the following locations:\n\n* `webapp/WEB-INF/templates/template.xhtml` and `resources/META-INF/resources/templates/template.xhtml` for the `left menu` based template\n* `webapp/WEB-INF/templates/template-top.xhtml` and `resources/META-INF/resources/templates/template-top.xhtml` for horizontal menu layout.\n\nNOTE: If you don't provide a \u003c\u003cApplication template\u003e\u003e then built in `admin.xhtml` and `admin-top.xhtml` templates will be used.\n\nSee admin-starer templates for a reference: https://github.com/adminfaces/admin-starter/tree/master/src/main/webapp/WEB-INF/templates\n\n== Configuration\n\nTemplate configuration is made through `admin-config.properties` file present in `src/main/resources` folder.\n\n\nHere are the default values as well as its description:\n\n----\nadmin.loginPage=login.xhtml \u003c1\u003e\nadmin.indexPage=index.xhtml \u003c2\u003e\nadmin.dateFormat= \u003c3\u003e\nadmin.breadcrumbSize=5 \u003c4\u003e\nadmin.renderMessages=true \u003c5\u003e\nadmin.renderAjaxStatus=true \u003c6\u003e\nadmin.disableFilter=false \u003c7\u003e\nadmin.renderBreadCrumb=true \u003c8\u003e\nadmin.enableSlideMenu=true \u003c9\u003e\nadmin.enableRipple=true \u003c10\u003e\nadmin.rippleElements= .ripplelink,button.ui-button,.ui-selectlistbox-item,.ui-multiselectlistbox-item,.ui-selectonemenu-label,.ui-selectcheckboxmenu,\\\n.ui-autocomplete-dropdown, .ui-autocomplete-item ... (the list goes on) \u003c11\u003e\nadmin.skin=skin-blue \u003c12\u003e\nadmin.autoShowNavbar=true \u003c13\u003e\nadmin.ignoredResources= \u003c14\u003e\nadmin.loadingImage=ajaxloadingbar.gif \u003c15\u003e\nadmin.extensionLessUrls=false \u003c16\u003e\nadmin.renderControlSidebar=false \u003c17\u003e\nadmin.controlSidebar.showOnMobile=false \u003c18\u003e\nadmin.controlSidebar.leftMenuTemplate=true \u003c19\u003e\nadmin.controlSidebar.fixedLayout=false \u003c20\u003e\nadmin.controlSidebar.boxedLayout=false \u003c21\u003e\nadmin.controlSidebar.sidebarCollapsed=false \u003c22\u003e\nadmin.controlSidebar.expandOnHover=false \u003c23\u003e\nadmin.controlSidebar.fixed=false \u003c24\u003e\nadmin.controlSidebar.darkSkin=true \u003c25\u003e\nadmin.rippleMobileOnly=true \u003c26\u003e\nadmin.renderMenuSearch=true \u003c27\u003e\nadmin.autoHideMessages=true \u003c28\u003e\nadmin.messagesHideTimeout=2500 \u003c29\u003e\nadmin.iconsEffect=true \u003c30\u003e\n\n\n----\n\u003c1\u003e login page location (relative to webapp). It you only be used if you configure \u003c\u003cAdmin Session\u003e\u003e.\n\u003c2\u003e index page location. User will be redirected to it when it access app root (contextPath/).\n\u003c3\u003e Date format used in error page (http://admin-showcase-admin-showcase.7e14.starter-us-west-2.openshiftapps.com/showcase/500.xhtml[500.xhtml^]), by default it is JVM default format.\n\u003c4\u003e Number of breadcrumbs to queue before removing the older ones.\n\u003c5\u003e When false, p:messages defined in admin template will not be rendered.\n\u003c6\u003e When false ajaxStatus, which triggers the loading bar on every ajax request, will not be rendered.\n\u003c7\u003e Disables AdminFilter, responsible for redirecting user after session timeout, sending user to logon page when it is not logged in among other things.\n\u003c8\u003e When false, the breadCrumb component, declared in admin template, will not be rendered.\n\u003c9\u003e If true will make left menu touch enable (can be closed or opened via touch). Can be enable/disabled per page with \u003cui:param name=\"enableSlideMenu\" value=\"false\".\n\u003c10\u003e When true it will create a http://materializecss.com/waves.html#![wave/ripple effect^] on elements specified by `rippleElements`.\n\u003c11\u003e A list of comma separated list of (jquery) selector which elements will be affected by ripple effect.\n\u003c12\u003e Default template skin.\n\u003c13\u003e Automatic shows navbar when users scrolls page up `on small screens`. Can be enable/disabled per page with \u003cui:param name=\"autoShowNavbar\" value=\"false\".\n\u003c14\u003e Comma separated resources (pages or urls) to be skiped by AdminFilter. Ex: /rest, /pages/car-list. Note that by default the filter skips pages under *CONTEXT/public/* folder.\n\u003c15\u003e image used for the loading popup. It must be under `webapp/resources/images` folder.\n\u003c16\u003e Removes extension suffix from breadCrumb links.\n\u003c17\u003e When true it will activate \u003c\u003cControl Sidebar, control sidebar\u003e\u003e component.\n\u003c18\u003e When true control sidebar will be also rendered on mobile devices.\n\u003c19\u003e Switches layout between left (default) and top menu.\n\u003c20\u003e Toggles fixed layout where navbar is fixed on the page.\n\u003c21\u003e Toggles boxed layout which is helpful when working on large screens because it prevents the site from stretching very wide.\n\u003c22\u003e When true left sidebar will be collapsed.\n\u003c23\u003e When true left sidebar will expand on mouse hover.\n\u003c24\u003e When true control sidebar will be fixed on the page.\n\u003c25\u003e Changes control sidebar skin between `dark` and `light`.\n\u003c26\u003e When true the ripple effect will be enabled only on mobile (small) screens.\n\u003c27\u003e Enables or disables menu  search.\n\u003c28\u003e If true PrimeFaces *info* messages will be hidden after a certain timeout.\n\u003c29\u003e Timeout to hide info messages. Note that the timeout is composed by `configured timeout + number of words` in message.\n\u003c30\u003e Enables material effect when icons (e.g modal close, calendar) are clicked.\n\nIMPORTANT: You don't need to declare all values in your admin-config.properties, you can specify only the ones you need to change.\n\nTIP: Since vRC16 config properties can be passed as Java `system properties`.\n\nNOTE: Controlsidebar entries (admin.controlSidebar.xxx) will be used only for initial/default values because they will be stored on browser local storage as soon as user changes them.\n\n== Admin Session\n\nAdminSession is a simple session scoped bean which controls whether user is logged in or not.\n\n----\n public boolean isLoggedIn(){\n        return isLoggedIn; //always true by default\n    }\n----\n\nBy default the user *is always logged in* and you need to override it (by using https://github.com/adminfaces/admin-starter/blob/2659e762271f9e1864bd2290f3dbf5018087eccd/src/main/java/com/github/adminfaces/starter/infra/security/LogonMB.java#L28[bean specialization^] or via injection and calling `setIsLoggedIn()` method) to change its value, see \u003c\u003cOverriding AdminSession\u003e\u003e.\n\nWhen isLoggedIn is `false` you got the following mechanisms activated:\n\n. Access to any page, besides the login, redirects user to login;\n. When session is expired user is redirected to logon and current page (before expiration) is saved so user is redirected back to where it was before session expiration.\n\nNOTE: It is up to you to decide whether the user is logged in or not.\n\n=== Overriding AdminSession\n\nThere are two ways to override AdminSession default value which is \u003c\u003cAdminSession Specialization, specialization\u003e\u003e and \u003c\u003cAdminSession Injection, injection\u003e\u003e.\n\n==== AdminSession Specialization\n\nA simple way to change AdminSession logged in value is by extending it:\n\n[source,java]\n----\nimport jakarta.enterprise.context.SessionScoped;\nimport jakarta.enterprise.inject.Specializes;\nimport com.github.adminfaces.template.session.AdminSession;\nimport org.omnifaces.util.Faces;\nimport java.io.Serializable;\n\n@SessionScoped\n@Specializes\npublic class LogonMB extends AdminSession implements Serializable {\n\n    private String currentUser;\n    private String email;\n    private String password;\n    private boolean remember;\n\n\n    public void login() throws IOException {\n        currentUser = email;\n        addDetailMessage(\"Logged in successfully as \u003cb\u003e\" + email + \"\u003c/b\u003e\");\n        Faces.getExternalContext().getFlash().setKeepMessages(true);\n        Faces.redirect(\"index.xhtml\");\n    }\n\n    @Override\n    public boolean isLoggedIn() {\n\n        return currentUser != null;\n    }\n\n    //getters\u0026setters\n}\n----\n\n=== AdminSession Injection\n\nAnother way is to inject it into your security authentication logic:\n\n\n[source,java]\n----\nimport com.github.adminfaces.template.session.AdminSession;\nimport org.omnifaces.util.Messages;\nimport org.omnifaces.util.Faces;\n\n@SessionScoped\n@Named(\"authorizer\")\npublic class CustomAuthorizer implements Serializable {\n\n    private String currentUser;\n\n    @Inject\n    AdminSession adminSession;\n\n    public void login(String username) {\n        currentUser = username;\n        adminSession.setIsLoggedIn(true);\n        Messages.addInfo(null,\"Logged in sucessfully as \u003cb\u003e\"+username+\"\u003c/b\u003e\");\n        Faces.redirect(\"index.xhtml\");\n    }\n\n}\n----\n\nIMPORTANT: As isLoggedIn is `true by default` you need to set it to false on application startup so user is redirected to login page. This step is not needed when \u003c\u003cAdminSession Specialization\u003e\u003e.\n\n\n== Error Pages\n\nThe template comes with custom error pages like `403`, `404`, `500`, `ViewExpired` and `OptimisticLock`.\n\n.500\nUser is going to be redirected to http://admin-showcase-admin-showcase.7e14.starter-us-west-2.openshiftapps.com/showcase/500.xhtml[*500.xhtml*^] whenever a _500_ response code is returned in a request.\n\nThe page will also be triggered when a `Throwable` is raised (and not catch).\n\nHere is how 500 page look like:\n\nimage::https://raw.githubusercontent.com/adminfaces/admin-docs/master/src/docs/images/500.png[]\n\n.403\nUser is redirected to http://admin-showcase-admin-showcase.7e14.starter-us-west-2.openshiftapps.com/showcase/403.xhtml[403.xhtml^] whenever a _403_ response code is returned in a request. The page will also be triggered when a `com.github.adminfaces.template.exception.AccessDeniedException` is raised.\n\nimage::https://raw.githubusercontent.com/adminfaces/admin-docs/master/src/docs/images/403.png[]\n\n.404\nUser will be redirected to http://admin-showcase-admin-showcase.7e14.starter-us-west-2.openshiftapps.com/showcase/non-existing.xhtml[404.xhtml^] whenever a 404 response code is returned from a request.\n\nimage::https://raw.githubusercontent.com/adminfaces/admin-docs/master/src/docs/images/404.png[]\n\n.ViewExpired\nWhen a JSF `javax.faces.application.ViewExpiredException` is raised user will be redirected to http://admin-showcase-admin-showcase.7e14.starter-us-west-2.openshiftapps.com/showcase/expired.xhtml[expired.xhtml^].\n\nimage::https://raw.githubusercontent.com/adminfaces/admin-docs/master/src/docs/images/expired.png[]\n\n.OptimisticLock\nWhen a JPA `javax.persistence.OptimisticLockException` is thrown user will be redirected to http://admin-showcase-admin-showcase.7e14.starter-us-west-2.openshiftapps.com/showcase/optimistic.xhtml[optimistic.xhtml^].\n\nimage::https://raw.githubusercontent.com/adminfaces/admin-docs/master/src/docs/images/optimistic.png[]\n\n=== Providing custom error pages\n\nYou can provide your own custom pages (and other status codes) by configuring them in web.xml, example:\n\n[source,xml]\n----\n\u003cerror-page\u003e\n    \u003cerror-code\u003e404\u003c/error-code\u003e\n    \u003clocation\u003e/404.xhtml\u003c/location\u003e\n\u003c/error-page\u003e\n\u003cerror-page\u003e\n    \u003cerror-code\u003e500\u003c/error-code\u003e\n    \u003clocation\u003e/500.xhtml\u003c/location\u003e\n\u003c/error-page\u003e\n\u003cerror-page\u003e\n    \u003cexception-type\u003ejava.lang.Throwable\u003c/exception-type\u003e\n    \u003clocation\u003e/500.xhtml\u003c/location\u003e\n\u003c/error-page\u003e\n----\n\n=== Overriding error pages\n\nYou can also override error pages by placing the pages (with same name) described in \u003c\u003cError Pages\u003e\u003e section on the root of your application (`webapp/`).\n\n== Internationalization\n\nLabels in \u003c\u003cError Pages, error pages\u003e\u003e and \u003c\u003cControl Sidebar, control sidebar\u003e\u003e are provided via http://docs.oracle.com/javaee/6/tutorial/doc/bnaxw.html#bnaxy[JSF resource bundle] mechanism.\n\nFollowing are the default labels in admin resource bundle:\n\n.src/main/resources/admin.properties\n----\n#general\nadmin.version=${project.version}\nlabel.home=Home\nlabel.go-back=Go back to\nlabel.or-to=or to\nlabel.previous-page=previous page\n\n#403\nlabel.403.header=403\nlabel.403.message=Access denied! You do not have access to the requested page.\n\n#404\nlabel.404.header=404\nlabel.404.message=Oops! Page not found\n\n#500\nlabel.500.header=500\nlabel.500.message=Oops! Something went wrong\nlabel.500.title=Unexpected error\nlabel.500.detail=Details\n\n#expired\nlabel.expired.title=View expired\nlabel.expired.message= The requested page could not be recovered.\nlabel.expired.click-here= Click here to reload the page.\n\n#optimistic\nlabel.optimistic.title=Record already updated\nlabel.optimistic.message= The requested record has been already updated by another user.\nlabel.optimistic.click-here= Click here to reload the updated record from database.\n\n#controlsidebar\ncontrolsidebar.header=Layout Options\ncontrolsidebar.label.restore-defaults=Restore defaults\ncontrolsidebar.label.menu-horientation=Left menu layout\ncontrolsidebar.txt.menu-horientation=Toggle menu orientation between \u003cb class\\=\"sidebar-bold\"\u003eleft\u003c/b\u003e and \u003cb class\\=\"sidebar-bold\"\u003etop\u003c/b\u003e menu.\ncontrolsidebar.label.fixed-layout=Fixed Layout\ncontrolsidebar.txt.fixed-layout=Activate the fixed layout, if checked the top bar will be fixed on the page.\ncontrolsidebar.label.boxed-layout=Boxed Layout\ncontrolsidebar.txt.boxed-layout=Activate the boxed layout.\ncontrolsidebar.label.sidebar-collapsed=Collapsed Sidebar\ncontrolsidebar.txt.sidebar-collapsed=If checked the sidebar menu will be collapsed.\ncontrolsidebar.label.sidebar-expand-hover=Sidebar Expand on Hover\ncontrolsidebar.txt.sidebar-expand-hover=If checked the left sidebar will expand on hover.\ncontrolsidebar.label.sidebar-slide=Control Sidebar fixed\ncontrolsidebar.txt.sidebar-slide=If checked control sidebar will be fixed on the page.\ncontrolsidebar.label.sidebar-skin=Dark Sidebar Skin\ncontrolsidebar.txt.sidebar-skin=If checked \u003cb class\\=\"sidebar-bold\"\u003edark\u003c/b\u003e skin will be used for control sidebar, otherwise \u003cb class\\=\"sidebar-bold\"\u003elight\u003c/b\u003e skin will be used.\ncontrolsidebar.header.skins=Skins\n\n#menu search\nmenu.search.placeholder=Search menu items...\n----\n\n[TIP]\n====\nYou can provide your own language bundle adding a file named _admin_YOUR_LANGUAGE.properties_ in your application `resources` folder.\n\nDon't forget to add it as `supported locale` in *faces-config*, see https://github.com/adminfaces/admin-template/blob/02c0db5d9ff567c803e7e83f336f8a7308e9d4ec/src/main/resources/META-INF/faces-config.xml#L9[example here^].\n\n====\n\nIMPORTANT: You can contribute your language locale to AdminFaces, https://github.com/adminfaces/admin-template/tree/master/src/main/resources[check here^] the current supported locales.\n\n\n== Control Sidebar\n\nControlSidebar is a component which provides a panel so user can `customize` the template layout:\n\nimage::https://raw.githubusercontent.com/adminfaces/admin-docs/master/src/docs/images/controlsidebar.png[]\n\nOptions selected by user are stored on `browser local storage` so they are remembered no matter the user logs off the application.\n\n\n=== Usage\n\nTo enable the control sidebar you need to add the following entry in `src/main/resources/admin-config.properties`:\n\n----\nadmin.renderControlSidebar=true\n----\n\nAnd then add a link or button on your page which opens the sidebar. The link or button must use `data-toggle` attribute:\n\n----\n  \u003ca href=\"#\" id=\"layout-setup\" data-toggle=\"control-sidebar\" class=\"hidden-sm hidden-xs\"\u003e\u003ci class=\"fa fa-gears\"\u003e\u003c/i\u003e\u003c/a\u003e\n----\n\nOn admin-starter the link is located on https://github.com/adminfaces/admin-starter/blob/c8adbe5e692171b144b93292e14ea203b654a13b/src/main/webapp/includes/top-bar.xhtml#L58[top-bar.xhtml^].\n\n{link-admin-showcase-openshift}/pages/layout/controlsidebar.xhtml[Click here^] to see controlsidebar in action on admin showcase.\n\n\nBy default the control sidebar comes only with the configuration tab but you can define additional tabs by defining `controlsidebar-tabs` and `controlsidebar-content` on your template. An example can be found on https://github.com/adminfaces/admin-starter/blob/c8adbe5e692171b144b93292e14ea203b654a13b/src/main/webapp/WEB-INF/templates/template.xhtml#L38[admin-starter template^].\n\n[TIP]\n====\nControlSidebar is hidden on mobile devices by default. You can change this on `admin-config.properties`:\n\n-----\n admin.controlSidebar.showOnMobile=true\n-----\n\nAlso don't forget to remove the `hidden-sm hidden-xs` classes from the button/link that opens the sidebar:\n\n----\n   \u003ca  href=\"#\" class=\"ui-link ui-widget\" data-toggle=\"control-sidebar\"\u003e\u003ci class=\"fa fa-gears\"\u003e\u003c/i\u003e\u003c/a\u003e\n----\n\n====\n\n== JakartaEE migration\n\nSince version `1.6.0` admin-template supports jakartaEE by default, https://github.com/adminfaces/admin-starter/blob/dda0a159fe9d604cbccecb9beab2b60f958569d0/pom.xml#L18-L34[see admin-starter^] for a sample project.\n\n== Docs\n\nhttps://adminfaces.github.io/docs/latest/#admin_template\n\n== Snapshots\n\nSnapshots are published to https://oss.sonatype.org/content/repositories/snapshots/com/github/adminfaces/[maven central^] on each commit, to use it just declare the repository below on your `pom.xml`:\n\n[source,xml]\n----\n\u003crepositories\u003e\n    \u003crepository\u003e\n        \u003csnapshots/\u003e\n        \u003cid\u003esnapshots\u003c/id\u003e\n        \u003cname\u003elibs-snapshot\u003c/name\u003e\n        \u003curl\u003ehttps://oss.sonatype.org/content/repositories/snapshots\u003c/url\u003e\n    \u003c/repository\u003e\n\u003c/repositories\u003e\n----\n","funding_links":[],"categories":["HarmonyOS","开发框架"],"sub_categories":["Windows Manager"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadminfaces%2Fadmin-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadminfaces%2Fadmin-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadminfaces%2Fadmin-template/lists"}