/**
   * Get the application class from the bean configured in Spring's context.
   *
   * @see AbstractApplicationServlet#getApplicationClass()
   */
  @Override
  protected Class<? extends Application> getApplicationClass() throws ClassNotFoundException {

    WebApplicationContext wac =
        WebApplicationContextUtils.getWebApplicationContext(getServletContext());

    if (wac == null) {
      throw new ClassNotFoundException(
          "Cannot get an handle on Spring's context. Is Spring running? "
              + "Check there's an org.springframework.web.context.ContextLoaderListener configured.");
    }
    String[] beanDefinitionNames = wac.getBeanDefinitionNames();
    for (String string : beanDefinitionNames) {
      System.out.println("SpringApplicationServlet.getApplicationClass() " + string);
    }

    Application bean = wac.getBean(name, Application.class);

    if (bean == null) {

      throw new ClassNotFoundException("No application bean found under name " + name);
    }

    return bean.getClass();
  }
Beispiel #2
0
 // TODO Test in portal environment.
 public Component inflate(Application app, String xmlFile) throws LayoutInflaterException {
   File layoutFile = getLayoutFile(app.getContext(), xmlFile);
   try {
     return inflate(new FileInputStream(layoutFile));
   } catch (FileNotFoundException e) {
     throw new LayoutInflaterException(
         "Given file " + layoutFile.getAbsolutePath() + " does not exist.");
   }
 }
 public void displayTaskById(String taskId) {
   BpmTask task =
       bpmSession.getTaskData(taskId, ProcessToolContext.Util.getThreadProcessToolContext());
   if (task != null) {
     displayProcessData(task);
   } else {
     application
         .getMainWindow()
         .showNotification(
             i18NSource.getMessage("process.data.task-notfound").replaceFirst("%s", taskId));
   }
 }
  @Override
  public void terminalError(Terminal.ErrorEvent event) {

    // Call the default implementation.
    super.terminalError(event);

    // Some custom behaviour.
    if (getMainWindow() != null) {
      getMainWindow()
          .showNotification(
              "An unchecked exception occured!",
              event.getThrowable().toString(),
              Window.Notification.TYPE_ERROR_MESSAGE);
    }
  }
Beispiel #5
0
 /**
  * Overrides ITMill Toolkit close() method to add some resources cleanup (in the future), related
  * to TPT. Please feel free to override this method in your application as well, however, do not
  * forget to call super.close() in your override.
  */
 @Override
 public void close() {
   super.close();
 }
Beispiel #6
0
 /**
  * This method is overridden as we want to reload theme-specific internationalization translation
  * files from the theme's i18n folder once theme is changed.
  *
  * @param themeName new theme name
  */
 @Override
 public void setTheme(String themeName) {
   super.setTheme(themeName);
   loadInternationalizationFiles();
 }