Package evolaris.framework.um.datamodel

Examples of evolaris.framework.um.datamodel.Group


   */
  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;
      }
    }

    // application selection
    Set<Application> applications = groupToDisplay.getApplications();
    Hibernate.initialize(applications);
    req.setAttribute("applications", applications);
    listForm.setApplicationId(applicationToDisplay != null ? applicationToDisplay.getId() : -1);

    // sorting
View Full Code Here


    Long selectedGroupId = messageSendForm.getGroupId();
    if (selectedGroupId == null){
      throw new ConfigurationException("validation of group failed: group ID = null");
    }
    GroupManager groupManager = new GroupManager(locale,session);
    Group group = groupManager.getGroup(selectedGroupId);
    if (group == null){
      throw new ConfigurationException("validation of group failed: group ID = " + selectedGroupId);
    }
    return group;
  }
View Full Code Here

   * @param req request
   * @param messageSendForm
   * @return
   */
  protected Group prepareGroup(HttpServletRequest req, F messageSendForm) {
    Group group = null;
    Group[] groups = null;
    if (UserManager.isUserInRole(webUser, UserManagerBase.ADMINISTRATOR)) {
      GroupManager groupMgm = new GroupManager(locale,session);
      Long selectedGroupId = messageSendForm.getGroupId();
      if (selectedGroupId == null) {
        // set the group name of the administrator group
        group = webUser.getGroup();
      } else {
        group = groupMgm.getGroup(selectedGroupId);
      }
      // set an array of groups into the request
      groups = groupMgm.getGroups();
    } else {
      group = webUser.getGroup();
      groups = new Group[]{group};
    }
    LOGGER.info("User " + req.getUserPrincipal().getName().toLowerCase() + ": Displaying information for group `" + group.getGroupname() + "`");
    messageSendForm.setGroupId(group.getId());
    req.getSession().setAttribute("groups", groups);
    return group;
  }
View Full Code Here

   */
  protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
   
    Session session = HibernateSessions.startTransaction(this.getClass());
    try {
      Group group = null;
      String groupId = request.getParameter("group");
      if (groupId == null) {
        String webUsername = request.getUserPrincipal().getName().toLowerCase();
        UserManagerBase userManager = new UserManager(Locale.GERMAN, session)
        User webUser = userManager.getUserDetails(webUsername);
View Full Code Here

  }
 
  private ActionForward switchCurrentGroup(ActionMapping mapping, ActionForm form, HttpServletRequest req, HttpServletResponse resp) {
    String name = req.getParameter("name");
    GroupManager groupMgr = new GroupManager(locale, session);
    Group group = groupMgr.getGroup(name);
    if (group == null) {
      throw new ConfigurationException("Switching groups failed: No group named `"+name+"` found.");     
    }
    setCurrentGroup(req, resp, group);
    LOGGER.debug("Switched to group `"+name+"`");
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) {
    AllowedInvocationListForm f = (AllowedInvocationListForm)form;
    Group groupToDisplay = getCurrentGroup(req);
    if (Boolean.TRUE.equals(f.getAllGroups()) && UserManager.isUserInRole(webUser, UserManagerBase.ADMINISTRATOR)) {
      groupToDisplay = null;
    }
   
    SmsDbManager smsDbManager = new SmsDbManager(locale, session);
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

 
  /**
   * @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);
    BlogManager mgr = new BlogManager(locale, session);
    List<Blog> blogs = mgr.getBlogs(group);
    List<BlogListEntry> entries = new ArrayList<BlogListEntry>();
    if (blogs != null) {
      for (Blog b : blogs) {
View Full Code Here

    this.session = session;
  }
 
  private Group mgblGroup(){
    GroupManager groupManager = new GroupManager(locale,session);
    Group group = groupManager.getGroup(MGBL_GROUPNAME);
    if (group == null){
      throw new ConfigurationException("No group with mGBL groupname `" + MGBL_GROUPNAME + "` found");
    }
    return group;
  }
View Full Code Here

   * @param name  name of the new application
   * @param description optional description of the application (may be null)
   * @return the created application object containing a valid database ID
   */
  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);
View Full Code Here

TOP

Related Classes of evolaris.framework.um.datamodel.Group

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.