Package fr.openwide.maven.artifact.notifier.core.business.user.model

Examples of fr.openwide.maven.artifact.notifier.core.business.user.model.UserGroup


  public UserGroupFormPopupPanel(String id, IModel<UserGroup> userGroupModel) {
    this(id, userGroupModel, FormPanelMode.EDIT);
  }

  public UserGroupFormPopupPanel(String id) {
    this(id, new GenericEntityModel<Long, UserGroup>(new UserGroup()), FormPanelMode.ADD);
  }
View Full Code Here


    AjaxButton validate = new AjaxButton("save", userGroupForm) {
      private static final long serialVersionUID = 1L;
     
      @Override
      protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
        UserGroup userGroup = UserGroupFormPopupPanel.this.getModelObject();
       
        try {
          if (isAddMode()) {
            userGroupService.create(userGroup);
            Session.get().success(getString("administration.usergroup.form.add.success"));
View Full Code Here

  @Override
  protected void onShow(AjaxRequestTarget target) {
    super.onShow(target);
    if (isAddMode()) {
      getModel().setObject(new UserGroup());
    }
  }
View Full Code Here

          private static final long serialVersionUID = -5179621361619239269L;
         
          @Override
          public void onClick(AjaxRequestTarget target) {
            try {
              UserGroup userGroup = UserGroupMembersPanel.this.getModelObject();
              User user = getModelObject();
             
              userGroupService.removeUser(userGroup, user);
              Session.get().success(getString("administration.usergroup.members.delete.success"));
            } catch (Exception e) {
              LOGGER.error("Error occured while removing user from user group", e);
              Session.get().error(getString("administration.usergroup.members.delete.error"));
            }
            target.add(getPage());
            FeedbackUtils.refreshFeedback(target, getPage());
          }
        });
      }
    };
    add(memberListView);
   
    add(new WebMarkupContainer("emptyList") {
      private static final long serialVersionUID = 6700720373087584498L;

      @Override
      public void onConfigure() {
        super.onConfigure();
        setVisible(memberListView.size() <= 0);
      }
    });
   
    // Add member form
    IModel<User> emptyUserModel = new GenericEntityModel<Long, User>(null);
   
    final UserAutocompleteAjaxComponent userAutocomplete = new UserAutocompleteAjaxComponent("userAutocomplete",
        emptyUserModel);
    userAutocomplete.setAutoUpdate(true);
   
    final Form<User> addMemberForm = new Form<User>("addMemberForm", emptyUserModel);
    addMemberForm.add(userAutocomplete);
    addMemberForm.add(new AjaxSubmitLink("addMemberLink", addMemberForm) {
      private static final long serialVersionUID = 6935376642872117563L;
     
      @Override
      protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
        UserGroup userGroup = UserGroupMembersPanel.this.getModelObject();
        User selectedUser = userAutocomplete.getModelObject();
       
        if (selectedUser != null) {
          try {
            userGroupService.addUser(userGroup, selectedUser);
View Full Code Here

    return new ResourceModel("common.portfolio.action.viewDetails");
  }

  @Override
  protected boolean hasWritePermissionOn(IModel<? extends UserGroup> userGroupModel) {
    UserGroup userGroup = (UserGroup) userGroupModel.getObject();
    return !userGroup.isLocked();
  }
View Full Code Here

          private static final long serialVersionUID = -5179621361619239269L;
         
          @Override
          public void onClick(AjaxRequestTarget target) {
            try {
              UserGroup userGroup = getModelObject();
              User user = UserMembershipsPanel.this.getModelObject();
             
              userGroupService.removeUser(userGroup, user);
              Session.get().success(getString("administration.usergroup.members.delete.success"));
            } catch (Exception e) {
              LOGGER.error("Error occured while removing user from user group", e);
              Session.get().error(getString("administration.usergroup.members.delete.error"));
            }
            target.add(getPage());
            FeedbackUtils.refreshFeedback(target, getPage());
          }
        });
      }
    };
    add(userGroupListView);
   
    add(new WebMarkupContainer("emptyList") {
      private static final long serialVersionUID = -784607577583169098L;
     
      @Override
      public void onConfigure() {
        super.onConfigure();
        setVisible(userGroupListView.size() <= 0);
      }
    });
   
    // Add group form
    IModel<UserGroup> emptyUserGroupModel = new GenericEntityModel<Long, UserGroup>(null);
   
    final UserGroupAutocompleteAjaxComponent userGroupAutocomplete = new UserGroupAutocompleteAjaxComponent(
        "userGroupAutocomplete", emptyUserGroupModel);
    userGroupAutocomplete.setAutoUpdate(true);
   
    final Form<UserGroup> addGroupForm = new Form<UserGroup>("addGroupForm", emptyUserGroupModel);
    addGroupForm.add(userGroupAutocomplete);
    addGroupForm.add(new AjaxSubmitLink("addGroupLink", addGroupForm) {
      private static final long serialVersionUID = 6935376642872117563L;
     
      @Override
      protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
        User user = UserMembershipsPanel.this.getModelObject();
        UserGroup selectedUserGroup = userGroupAutocomplete.getModelObject();
       
        if (selectedUserGroup != null) {
          try {
            userGroupService.addUser(selectedUserGroup, user);
            getSession().success(getString("administration.usergroup.members.add.success"));
View Full Code Here

TOP

Related Classes of fr.openwide.maven.artifact.notifier.core.business.user.model.UserGroup

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.