예제 #1
0
 @Override
 protected void onConfigure() {
   super.onConfigure();
   AuthenticatedWebApplication app = (AuthenticatedWebApplication) Application.get();
   if (!AuthenticatedWebSession.get().isSignedIn()) {
     app.restartResponseAtSignInPage();
   }
 }
예제 #2
0
 /** @see org.apache.wicket.authentication.AuthenticatedWebApplication#init() */
 @Override
 protected void init() {
   super.init();
   getDebugSettings().setDevelopmentUtilitiesEnabled(true);
   // getDebugSettings().setAjaxDebugModeEnabled(true);
   getResourceSettings().setThrowExceptionOnMissingResource(false);
   uploadFolder = new Folder(System.getProperty("java.io.tmpdir"), "wicket-uploads");
   // Ensure folder exists
   uploadFolder.mkdirs();
 }
예제 #3
0
  @Override
  public void init() {
    super.init();

    getFrameworkSettings().setSerializer(new Fast2WicketSerializer());

    getJavaScriptLibrarySettings()
        .setJQueryReference(
            new PackageResourceReference(
                MidPointApplication.class,
                "../../../../../webjars/adminlte/2.3.0/plugins/jQuery/jQuery-2.1.4.min.js"));

    GuiComponents.init();

    getComponentInstantiationListeners().add(new SpringComponentInjector(this));

    ResourceSettings resourceSettings = getResourceSettings();
    resourceSettings.setParentFolderPlaceholder("$-$");
    resourceSettings.setHeaderItemComparator(new PriorityFirstComparator(true));
    SecurePackageResourceGuard guard =
        (SecurePackageResourceGuard) resourceSettings.getPackageResourceGuard();
    guard.addPattern("+*.woff2");

    List<IStringResourceLoader> resourceLoaders = resourceSettings.getStringResourceLoaders();
    resourceLoaders.add(0, new Utf8BundleStringResourceLoader("localization/Midpoint"));
    resourceLoaders.add(
        1,
        new Utf8BundleStringResourceLoader(
            SchemaConstants.SCHEMA_LOCALIZATION_PROPERTIES_RESOURCE_BASE_PATH));

    resourceSettings.setThrowExceptionOnMissingResource(false);
    getMarkupSettings().setStripWicketTags(true);
    //        getMarkupSettings().setDefaultBeforeDisabledLink("");
    //        getMarkupSettings().setDefaultAfterDisabledLink("");

    if (RuntimeConfigurationType.DEVELOPMENT.equals(getConfigurationType())) {
      getDebugSettings().setAjaxDebugModeEnabled(true);
      getDebugSettings().setDevelopmentUtilitiesEnabled(true);
    }

    // pretty url for resources (e.g. images)
    mountFiles(ImgResources.BASE_PATH, ImgResources.class);

    // exception handling an error pages
    ApplicationSettings appSettings = getApplicationSettings();
    appSettings.setAccessDeniedPage(PageError401.class);
    appSettings.setInternalErrorPage(PageError.class);
    appSettings.setPageExpiredErrorPage(PageError.class);

    mount(new MountedMapper("/error", PageError.class, MidPointPageParametersEncoder.ENCODER));
    mount(
        new MountedMapper("/error/401", PageError401.class, MidPointPageParametersEncoder.ENCODER));
    mount(
        new MountedMapper("/error/403", PageError403.class, MidPointPageParametersEncoder.ENCODER));
    mount(
        new MountedMapper("/error/404", PageError404.class, MidPointPageParametersEncoder.ENCODER));
    mount(
        new MountedMapper("/error/410", PageError410.class, MidPointPageParametersEncoder.ENCODER));

    getRequestCycleListeners().add(new LoggingRequestCycleListener(this));

    // descriptor loader, used for customization
    new DescriptorLoader().loadData(this);
  }
예제 #4
0
  @Override
  protected void onDestroy() {
    GuiComponents.destroy();

    super.onDestroy();
  }