Package org.apache.openmeetings.db.entity.user

Examples of org.apache.openmeetings.db.entity.user.Organisation


    updateView(target);
  }
 
  @Override
  protected void onRefreshSubmit(AjaxRequestTarget target, Form<?> form) {
    Organisation org = getModelObject();
    if (org.getOrganisation_id() != null) {
      org = getBean(OrganisationDao.class).get(org.getOrganisation_id());
    } else {
      org = new Organisation();
    }
    setModelObject(org);
    updateView(target);
  }
View Full Code Here


    assertNotNull("Unable to found [organisation, user] pair - [" + orgId + "," + u.getUser_id() + "]", ou);
  }
 
  @Test
  public void addOrganisation() {
    Organisation o = new Organisation();
    o.setName(ORG_NAME);
    Long orgId = orgDao.update(o, null).getOrganisation_id(); //inserted by not checked
    assertNotNull("New Organisation have valid id", orgId);
   
    List<Organisation_Users> ul = orgUserDao.get(orgId, 0, 9999);
    assertTrue("New Organisation should contain NO users: " + ul.size(), ul.size() == 0);
View Full Code Here

  public Organisation get(long id) {
    TypedQuery<Organisation> query = em.createNamedQuery("getOrganisationById", Organisation.class);
    query.setParameter("organisation_id", id);
    query.setParameter("deleted", false);
    Organisation o = null;
    try {
      o = query.getSingleResult();
    } catch (NoResultException e) {
      // o = null;
    }
View Full Code Here

    if (default_lang_id == null) {
      default_lang_id = 1L;
    }

    // Add default group
    Organisation org = new Organisation();
    org.setName(cfg.group);
    org.setInsertedby(1L);
    org.setDeleted(false);
    org.setStarttime(new Date());
    org = organisationDao.update(org, null);

    Set<Right> rights = UserDao.getDefaultRights();
    rights.add(Right.Admin);
    rights.add(Right.Soap);
    Long user_id = userManager.registerUserInit(rights, cfg.username, cfg.password, "lastname"
        , "firstname", cfg.email, new Date() /* age/birthday */, "street", "no", "fax", "zip", 1
        , "town", default_lang_id, false /* sendWelcomeMessage */
        , Arrays.asList(org.getOrganisation_id()), "phone", false, false, timezoneUtil.getTimeZone(cfg.ical_timeZone),
        false /* forceTimeZoneCheck */, "" /* userOffers */, "" /* userSearchs */, false /* showContactData */,
        true /* showContactDataToContacts */, null);

    log.debug("Installation - User Added user-Id " + user_id);

View Full Code Here

  }
 
  @Override
  protected void onDeleteSubmit(AjaxRequestTarget target, Form<?> form) {
    getBean(OrganisationDao.class).delete(getModelObject(), getUserId());
    setModelObject(new Organisation());
    updateView(target);
  }
View Full Code Here

    updateView(target);
  }
 
  @Override
  protected void onSaveSubmit(AjaxRequestTarget target, Form<?> form) {
    Organisation o = getModelObject();
    o = getBean(OrganisationDao.class).update(o, getUserId());
    setModelObject(o);
    getBean(OrganisationUserDao.class).update(usersPanel.getUsers2add(), getUserId());
    hideNewRecord();
    updateView(target);
View Full Code Here

  public GroupsPanel(String id) {
    super(id);
    final WebMarkupContainer listContainer = new WebMarkupContainer("listContainer");
       
    //Adding the Group Form
    form = new GroupForm("form", listContainer, new Organisation());
        add(form);

        //List view
        SearchableDataView<Organisation> dataView = new SearchableDataView<Organisation>("groupList", new SearchableDataProvider<Organisation>(OrganisationDao.class)) {
      private static final long serialVersionUID = 1L;

      @Override
      protected void populateItem(Item<Organisation> item) {
        final Organisation o = item.getModelObject();
        item.add(new Label("organisation_id", "" + o.getOrganisation_id()));
        item.add(new Label("name", "" + o.getName()));
        item.add(new AjaxEventBehavior("onclick") {
          private static final long serialVersionUID = -8069413566800571061L;

          protected void onEvent(AjaxRequestTarget target) {
            form.hideNewRecord();
            form.setModelObject(o);
            form.updateView(target);
            target.add(listContainer);
            target.appendJavaScript("groupsInit();");
          }
        });
        item.add(AttributeModifier.append("class", "clickable ui-widget-content"
            + (o.getOrganisation_id().equals(form.getModelObject().getOrganisation_id()) ? " ui-state-active" : "")));
      }
    };

    //Paging
    add(listContainer.add(dataView).setOutputMarkupId(true));
View Full Code Here

            }
          }
        };
       
    //Adding the Group Form
    form = new GroupForm("form", listContainer, new Organisation()){
      private static final long serialVersionUID = 1L;

      private AjaxButton processAddClass() {
        boolean orgSaved = getModelObject().getOrganisation_id() != null;
        addUsersBtn.add(AttributeModifier.replace("class", orgSaved ? "formNewButton" : "formNewButton disabled"));
        addUsersBtn.setEnabled(orgSaved);
        return addUsersBtn;
      }
     
      @Override
      protected void onModelChanged() {
        super.onModelChanged();
        processAddClass();
      }
     
      @Override
      public void updateView(AjaxRequestTarget target) {
        super.updateView(target);
        target.add(processAddClass());
      }
    };
        add(form.add(addUsersBtn.setOutputMarkupId(true)));
        addUsersDialog = new AddUsersDialog("addUsers",WebSession.getString(180), form, true);
    add(addUsersDialog.setOutputMarkupId(true));

        //List view
        SearchableDataView<Organisation> dataView = new SearchableDataView<Organisation>("groupList", new SearchableDataProvider<Organisation>(OrganisationDao.class)) {
      private static final long serialVersionUID = 8715559628755439596L;

      @Override
      protected void populateItem(Item<Organisation> item) {
        final Organisation o = item.getModelObject();
        item.add(new Label("organisation_id", "" + o.getOrganisation_id()));
        item.add(new Label("name", "" + o.getName()));
        item.add(new AjaxEventBehavior("onclick") {
          private static final long serialVersionUID = -8069413566800571061L;

          protected void onEvent(AjaxRequestTarget target) {
            form.hideNewRecord();
            form.setModelObject(o);
            form.updateView(target);
            target.add(listContainer);
            target.appendJavaScript("groupsInit();");
          }
        });
        item.add(AttributeModifier.append("class", "clickable ui-widget-content"
            + (o.getOrganisation_id().equals(form.getModelObject().getOrganisation_id()) ? " selected" : "")));
      }
    };

    //Paging
    add(listContainer.add(dataView).setOutputMarkupId(true));
View Full Code Here

TOP

Related Classes of org.apache.openmeetings.db.entity.user.Organisation

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.