[[custom-pages]]
= Custom pages

:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR  CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.



In the vast majority of cases customization should be sufficient by xref:vw:ROOT:extending.adoc#replacing-page-elements[replacing elements of a page].
However, it is also possible to define an entirely new page for a given page type.

The Wicket viewer defines these page types (see the `org.apache.isis.viewer.wicket.model.models.PageType` enum):

.PageType enum
[cols="1,4", options="header"]
|===
| Page type
| Renders

| SIGN_IN
| The initial sign-in (aka login) page

| SIGN_UP
| The sign-up page (if xref:refguide:applib:index/services/userreg/UserRegistrationService.adoc[user registration] is enabled).

| SIGN_UP_VERIFY
| The sign-up verification page (if xref:refguide:applib:index/services/userreg/UserRegistrationService.adoc[user registration] is enabled; as accessed by link from verification email)

| PASSWORD_RESET
| The password reset page (if enabled).

| HOME
| The home page, displaying either the welcome message or dashboard

| HOME_AFTER_PAGETIMEOUT
| Variation on home page after a timeout.

| ABOUT
| The about page, accessible from link top-right

| ENTITY
| Renders a single entity or view model

| STANDALONE_COLLECTION
| Page rendered after invoking an action that returns a collection of entites

| VALUE
| After invoking an action that returns a value type (though not URLs or Blob/Clobs, as these are handled appropriately automatically).

| VOID_RETURN
| After invoking an action that is `void`

| ACTION_PROMPT
| (No longer used).

|===


The `PageClassList` interface declares which class (subclass of `org.apache.wicket.Page` is used to render for each of these types.
For example, Apache Isis' `WicketSignInPage` renders the signin page.

To specify a different page class, create a new implementation of `PageClassList` and annotate with an earlier precedence than the default.
If you are just tweaking the defaults, then its easiest to override `PageClassListDefault`:

[source,java]
----
@Service
@Priority(PriorityPrecedence.EARLY)
public class MyPageClassList extends PageClassListDefault {
    protected Class<? extends Page> getSignInPageClass() {
        return MySignInPage.class;
    }
}
----

