Package evolaris.framework.sys.business

Examples of evolaris.framework.sys.business.ApplicationManager


    Object destinationApplicationIdFromSession = req.getSession().getAttribute("destinationApplicationId");
    if (destinationApplicationIdFromSession != null){
      if (!(destinationApplicationIdFromSession instanceof Long)){
        throw new BugException("invalid destinationApplicationId parameter: " + destinationApplicationIdFromSession);
      }
      ApplicationManager applicationManager = new ApplicationManager(locale,session);
      destinationApplication = applicationManager.getApplication((Long)destinationApplicationIdFromSession);
      if (destinationApplication == null){
        throw new BugException("invalid destination application id: " + destinationApplicationIdFromSession);
      }
      destinationGroup = destinationApplication.getGroup();
    } else {
View Full Code Here


   *
   * @see org.apache.struts.action.Action#execute(org.apache.struts.action.ActionMapping, org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
   */
  public ActionForward list(ActionMapping mapping, ActionForm form, HttpServletRequest req, HttpServletResponse resp) {
    InteractionLogListForm listForm = (InteractionLogListForm)form;
    ApplicationManager applicationManager = new ApplicationManager(locale,session);

    Group groupToDisplay = null;
    Application applicationToDisplay = null;

    groupToDisplay = this.getCurrentGroup(req);
    Long applicationId = listForm.getApplicationId();
    if (applicationId != null && applicationId != -1) {
      Application application = applicationManager.getApplication(applicationId);
      if (application != null && application.getGroup() == groupToDisplay){
        applicationToDisplay = application;
      }
    }

View Full Code Here

  /**
   * @see org.apache.struts.action.Action#execute(org.apache.struts.action.ActionMapping, org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
   */
  public ActionForward list(ActionMapping mapping, ActionForm form, HttpServletRequest req, HttpServletResponse resp) {
    Group group = this.getCurrentGroup(req);
    ApplicationManager mgr = new ApplicationManager(locale, session);
    List<Application> apps = mgr.getApplications(group);
    req.setAttribute("applications", apps);
    return mapping.findForward("list");
  }
View Full Code Here

  public Application createApplication(String name){
    Group group = mgblGroup();
    Application application = new Application();
    application.setGroup(group);
    application.setName(name);
    ApplicationManager applicationManager = new ApplicationManager(locale,session);
    applicationManager.createApplication(application);
   
    session.saveOrUpdate(application);
    return application;
  }
View Full Code Here

  /**
   * @see evolaris.framework.sys.web.action.EnterEditDuplicateAction#entryFromDatabase(long)
   */
  @Override
  protected Application entryFromDatabase(long id) {
    ApplicationManager applicationManager = new ApplicationManager(locale,session);
    return applicationManager.getApplication(id);
  }
View Full Code Here

  // retrieves application from group and application  ID in form; returns a reasonable proposal if none available; throws exception if insufficient access rights
  // also sets session attribute "applications" with applications according to group
  // the application ID can be null if no information available or application not used in the JSP
  protected Application applicationPreparation(HttpServletRequest req, Group group, Long applicationId) {
    ApplicationManager applicationManager = new ApplicationManager(locale,session);
    List<Application> applications = applicationManager.getApplications(group);
    Application defaultApplication = group.getDefaultApplication()// may be null
    Application application = new Application();
    application.setId(-1);
    switch (applications.size()) {
    case 0:
      application.setName("(" + getLocalizedMessage("SystemWeb", "sys.noApplicationAvailable") + ")");
      applications.add(application);
      break;
    case 1:
      application = applications.iterator().next();
      break;
    default:
      if (defaultApplication != null){
        application = defaultApplication;
      } else {
        application.setName("(" + getLocalizedMessage("SystemWeb", "sys.noApplicationSelected") + ")");
        applications.add(0,application);
      }
    }
    req.getSession().setAttribute("applications", applications);
   
    if (applicationId != null){
      Application selectedApplication = applicationManager.getApplication(applicationId);
      if (selectedApplication != null && selectedApplication.getGroup() == group){
        application = selectedApplication;
      }
    }
    return application;
View Full Code Here

  /**
   * @see evolaris.framework.sys.web.form.EnterEditDuplicateForm#createEntry(java.lang.Object, java.util.Locale, org.hibernate.Session)
   */
  @Override
  public void createEntry(Application application, Locale locale, Session session) {
    ApplicationManager applicationManager = new ApplicationManager(locale,session);
    applicationManager.createApplication(application);
    setId(application.getId());
       }
View Full Code Here

  /**
   * @see evolaris.framework.sys.web.form.EnterEditDuplicateForm#modifyEntry(java.lang.Object, java.util.Locale, org.hibernate.Session)
   */
  @Override
  public void modifyEntry(Application application, Locale locale, Session session) {
    ApplicationManager applicationManager = new ApplicationManager(locale,session);
    applicationManager.modifyApplication(application);
  }
View Full Code Here

  /* (non-Javadoc)
   * @see evolaris.framework.sys.web.form.EnterEditDuplicateForm#delete(java.lang.Object, java.util.Locale, org.hibernate.Session, org.apache.struts.util.MessageResources)
   */
  @Override
  public void deleteEntry(Application application, Locale locale, Session session, MessageResources resources) {
    ApplicationManager applicationManager = new ApplicationManager(locale,session);
    applicationManager.deleteApplication(application);
       }
View Full Code Here

    group.setClientProject(clientProject);

    // default application
    Application defaultApplication = null;
    if (defaultApplicationId != null && defaultApplicationId >= 1){
      ApplicationManager applicationManager = new ApplicationManager(locale,session);
      Application selectedDefaultApplication = applicationManager.getApplication(defaultApplicationId);
      if (selectedDefaultApplication != null && selectedDefaultApplication.getGroup() == group){
        defaultApplication = selectedDefaultApplication;
      }
    }
    group.setDefaultApplication(defaultApplication);
View Full Code Here

TOP

Related Classes of evolaris.framework.sys.business.ApplicationManager

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.