Package de.iritgo.aktera.model

Examples of de.iritgo.aktera.model.ModelException


    String downloadDir = getConfiguration().getChild("directory").getValue(null);

    if (downloadDir == null)
    {
      log.error("No download directory specified");
      throw new ModelException("No download directory specified");
    }

    String urlBase = getConfiguration().getChild("url").getValue(null);

    if (urlBase == null)
    {
      log.error("No URL base specified");
      throw new ModelException("No URL base specified");
    }

    Output outList = response.createOutput("list");

    response.add(outList);
View Full Code Here


    {
      UpdateHelper.update(req, res, null);
    }
    catch (ServiceException x)
    {
      throw new ModelException(x);
    }

    Command cmd = res.createCommand("aktera.tools.goto-start-model");

    cmd.setName("cmd");
View Full Code Here

        {
          current = new String(oneEncryptor.hash(current.getBytes("UTF-8")), "UTF-8");
        }
        else
        {
          throw new ModelException("Method '" + method + "' invalid.");
        }
      }
      catch (UnsupportedEncodingException ue)
      {
        throw new ModelException(ue);
      }
      catch (NestedException ne)
      {
        throw new ModelException(ne);
      }
    }

    return current;
  }
View Full Code Here

        {
          current = new String(oneEncryptor.hash(current.getBytes("UTF-8")), "UTF-8");
        }
        else
        {
          throw new ModelException("Method '" + method + "' invalid.");
        }
      }
      catch (UnsupportedEncodingException ue)
      {
        throw new ModelException(ue);
      }
      catch (NestedException ne)
      {
        throw new ModelException(ne);
      }
    }

    return current;
  }
View Full Code Here

        {
          loginName = ue.getLoginName();
        }
        catch (AuthorizationException e)
        {
          throw new ModelException("Authorization error", e);
        }

        res.addOutput("logininfo", "Logged in as " + loginName);
      }
      else
      {
        throw new ModelException("Unable to get user-info from context, context was null");
      }
    }
    catch (ContextException ce)
    {
      log.debug("Unable to access user environment from context ");
View Full Code Here

    Context c = req.getContext();

    if (c == null)
    {
      throw new ModelException("No context established - request should have established context");
    }

    UserEnvironment userEnv = null;

    try
    {
      userEnv = (UserEnvironment) c.get(UserEnvironment.CONTEXT_KEY);

      if (userEnv != null)
      {
        int uid = userEnv.getUid();

        if (uid != UserEnvironment.ANONYMOUS_UID)
        {
          AuthenticationManager authMgr = (AuthenticationManager) req.getService(AuthenticationManager.ROLE,
                  "*");

          authMgr.setUsername(userEnv.getLoginName());
          authMgr.setPassword("");
          authMgr.setDomain(userEnv.getDomain());

          HashMap map = new HashMap();

          map.put("request", req);
          map.put("response", res);
          map.put("remember", new Boolean("off"));
          map.put("configuration", getConfiguration());
          authMgr.setOtherConfig(map);

          //Clear cookies if the clear-cookies config. attribute is true
          boolean clearCookies = configuration.getAttributeAsBoolean("clear-cookies", true);

          if (clearCookies)
          {
            HashMap cookies = new HashMap();

            cookies.put(getLoginCookieName(configuration), "");
            cookies.put(getPasswordCookieName(configuration), "");
            cookies.put(getDomainCookieName(configuration), "");
            res.setAttribute("cookies", cookies);
          }

          try
          {
            authMgr.logout(userEnv);
          }
          catch (Exception ee)
          {
            log.error("Logout Error", ee);
            throw new ModelException(ee);
          }

          userEnv.clearAttributes();
          userEnv.reset();

          //          DefaultContext dc = (DefaultContext) req.getContext ();
          //          dc.put (UserEnvironment.CONTEXT_KEY, null);
          PreferencesManager preferencesManager = (PreferencesManager) SpringTools
                  .getBean(PreferencesManager.ID);

          preferencesManager.clearCache(uid);
        }
      }
    }
    catch (ContextException e)
    {
      throw new ModelException("Unable to retrieve user env. to context", e);
    }
    catch (AuthorizationException e)
    {
      throw new ModelException("Authroization error", e);
    }

    res.addOutput("loggedOff", "Logged Off");

    return res;
View Full Code Here

        }
      }
    }
    catch (PersistenceException x)
    {
      throw new ModelException("[PreferencesManager] Unable to create default values", x);
    }
    catch (ConfigurationException x)
    {
      throw new ModelException("[PreferencesManager] Unable to create default values", x);
    }
  }
View Full Code Here

        }
      }
    }
    catch (PersistenceException x)
    {
      throw new ModelException("[PreferencesManager] Unable to create default value", x);
    }
    catch (ConfigurationException x)
    {
      throw new ModelException("[PreferencesManager] Unable to create default value", x);
    }
  }
View Full Code Here

        return res.createCommand("aktera.database.update-prompt").execute(req, res);
      }
    }
    catch (ConfigurationException x)
    {
      throw new ModelException("ConfigurationException during needUpdate() check", x);
    }

    try
    {
      SystemCheckService systemCheckService = (SystemCheckService) SpringTools.getBean(SystemCheckService.ID);
View Full Code Here

            : getConfiguration().getChild("filetype").getValue(null);

    if (downloadDir == null)
    {
      log.error("No download directory specified");
      throw new ModelException("No download directory specified");
    }

    String urlBase = getConfiguration().getChild("url").getValue(null);

    if (urlBase == null)
    {
      log.error("No URL base specified");
      throw new ModelException("No URL base specified");
    }

    Output player = response.createOutput("player");

    player.setAttribute("playerUrl", getConfiguration().getChild("playerUrl").getValue(null));
View Full Code Here

TOP

Related Classes of de.iritgo.aktera.model.ModelException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.