Package com.composum.sling.core
Class CoreConfigImpl
- java.lang.Object
-
- com.composum.sling.core.CoreConfigImpl
-
- All Implemented Interfaces:
CoreConfiguration
public class CoreConfigImpl extends Object implements CoreConfiguration
The configuration service for all servlets in the core bundle.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
CoreConfigImpl.Configuration
The configuration object for CoreConfigImpl.
-
Field Summary
Fields Modifier and Type Field Description protected static String
DEFAULT_LOGOUTURL
-
Fields inherited from interface com.composum.sling.core.CoreConfiguration
ERRORPAGE_STATUS, RESOURCE_PARAMETER
-
-
Constructor Summary
Constructors Constructor Description CoreConfigImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected void
activate(org.osgi.service.component.ComponentContext context, CoreConfigImpl.Configuration configuration)
protected void
deactivate()
boolean
forwardToErrorpage(org.apache.sling.api.SlingHttpServletRequest request, org.apache.sling.api.SlingHttpServletResponse response, int status)
String
getComposumBase()
org.apache.sling.api.resource.Resource
getErrorpage(org.apache.sling.api.SlingHttpServletRequest request, int status)
Determines the error page corresponding to the requested path.@Nullable String
getLoggedoutUrl()
The URL to redirect to after the user was logged out successfully.@NotNull String
getLoginUrl(@Nullable String targetUri)
Deprecated.@NotNull String
getLogoutUrl(@Nullable String targetUri)
The (relative) logout URL (including parameters) to use instead of the default /system/sling/logout.@NotNull Dictionary<String,Object>
getProperties()
The (readonly) properties useable for extensions.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.composum.sling.core.CoreConfiguration
getLoginUrl, getLogoutUrl
-
-
-
-
Field Detail
-
DEFAULT_LOGOUTURL
protected static final String DEFAULT_LOGOUTURL
- See Also:
- Constant Field Values
-
-
Method Detail
-
getComposumBase
public String getComposumBase()
- Specified by:
getComposumBase
in interfaceCoreConfiguration
-
getErrorpage
public org.apache.sling.api.resource.Resource getErrorpage(org.apache.sling.api.SlingHttpServletRequest request, int status)
Determines the error page corresponding to the requested path. Is searching upwards beginning with the requested path for an error page using the path pattern: {requested path}/{errorpagesPath}/{status code}. If nothing found the pattern: {defaultErrorpages}/{status code} is used if existing.- Specified by:
getErrorpage
in interfaceCoreConfiguration
- Returns:
- the error page found;
null
if no error page available
-
forwardToErrorpage
public boolean forwardToErrorpage(org.apache.sling.api.SlingHttpServletRequest request, org.apache.sling.api.SlingHttpServletResponse response, int status) throws javax.servlet.ServletException, IOException
- Specified by:
forwardToErrorpage
in interfaceCoreConfiguration
- Throws:
javax.servlet.ServletException
IOException
-
getProperties
@NotNull public @NotNull Dictionary<String,Object> getProperties()
Description copied from interface:CoreConfiguration
The (readonly) properties useable for extensions. E.g. introduce a new property in a newer nodes version, and use it if accessible already when depending on an older nodes version.- Specified by:
getProperties
in interfaceCoreConfiguration
-
getLoginUrl
@Deprecated @NotNull public @NotNull String getLoginUrl(@Nullable @Nullable String targetUri)
Deprecated.Description copied from interface:CoreConfiguration
The URL to redirect to when the user should login. A parameterCoreConfiguration.RESOURCE_PARAMETER
- the targetUri - can be appended if after user login in the user should redirect to rendering that resource.- Specified by:
getLoginUrl
in interfaceCoreConfiguration
-
getLogoutUrl
@NotNull public @NotNull String getLogoutUrl(@Nullable @Nullable String targetUri)
Description copied from interface:CoreConfiguration
The (relative) logout URL (including parameters) to use instead of the default /system/sling/logout. A parameterCoreConfiguration.RESOURCE_PARAMETER
- the targetUri - can be appended if after user logout the user should be redirected to that target.- Specified by:
getLogoutUrl
in interfaceCoreConfiguration
-
getLoggedoutUrl
@Nullable public @Nullable String getLoggedoutUrl()
Description copied from interface:CoreConfiguration
The URL to redirect to after the user was logged out successfully.- Specified by:
getLoggedoutUrl
in interfaceCoreConfiguration
-
activate
protected void activate(org.osgi.service.component.ComponentContext context, CoreConfigImpl.Configuration configuration)
-
deactivate
protected void deactivate()
-
-