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

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


            }
          }
        };
       
    //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 "
            + (item.getIndex() % 2 == 1 ? "even" : "odd")
            + (o.getOrganisation_id().equals(form.getModelObject().getOrganisation_id()) ? " selected" : "")));
      }
    };

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


    add(trash/*.add(new WindowsTheme())*/); //TODO check theme here
    RepeatingView treesView = new RepeatingView("tree");
    treesView.add(selected = new RecordingTree(treesView.newChildId(), new MyRecordingTreeProvider()));
    treesView.add(new RecordingTree(treesView.newChildId(), new PublicRecordingTreeProvider(null, null)));
    for (Organisation_Users ou : getBean(UserDao.class).get(getUserId()).getOrganisation_users()) {
      Organisation o = ou.getOrganisation();
      treesView.add(new RecordingTree(treesView.newChildId(), new PublicRecordingTreeProvider(o.getOrganisation_id(), o.getName())));
    }
    add(trees.add(treesView).setOutputMarkupId(true));
    updateSizes();
    add(sizes.add(new Label("homeSize", homeSize), new Label("publicSize", publicSize)).setOutputMarkupId(true));
    sizes.add(new AjaxSelfUpdatingTimerBehavior(Duration.seconds(30)) {
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);

    Long user_id = userManager.registerUserInit(new Long(3), 3, 1,
        1, cfg.username, cfg.password, "lastname", "firstname", cfg.email,
        new java.util.Date(), "street", "no", "fax", "zip", 1,
        "town", default_lang_id, false,
        Arrays.asList(org.getOrganisation_id()), "phone", false, false,
        timezoneUtil.getTimeZone(cfg.ical_timeZone),
        false, "", "", false, true, null);

    log.debug("Installation - User Added user-Id " + user_id);
View Full Code Here

   * @throws AxisFault
   */
  public Long addOrganisation(String SID, String name) throws AxisFault {
    Long users_id = sessiondataDao.checkSession(SID);
    if (AuthLevelUtil.hasWebServiceLevel(userDao.getRights(users_id))) {
      Organisation o = new Organisation();
      o.setName(name);
      return orgDao.update(o, users_id).getOrganisation_id();
    }
    log.error("Could not create organization");
    return -1L;
  }
View Full Code Here

  private static final Logger log = Logger.getLogger(TestAddGroup.class);

  @Test
  public void testAddingGroup() {
    Organisation o = new Organisation();
    o.setName("default");
    o = orgDao.update(o, null);
    assertNotNull("Id of organisation created should not be null", o.getOrganisation_id());

    User us = usersDao.get(1L);
    assertNotNull("User should exist", us);
   
    assertNotNull("Organisation User list should exist", us.getOrganisation_users());
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

 
  public Organisation read(InputNode node) throws Exception {
    long oldId = getlongValue(node);
    long newId = idMap.containsKey(oldId) ? idMap.get(oldId) : oldId;
   
    Organisation o = orgDao.get(newId);
    return o == null ? new Organisation() : o;
  }
View Full Code Here

    add(new ListView<Organisation_Users>("orgTabs", u.getOrganisation_users()) {
      private static final long serialVersionUID = -145637079945252731L;

      @Override
      protected void populateItem(ListItem<Organisation_Users> item) {
        Organisation org = item.getModelObject().getOrganisation();
        item.add(new WebMarkupContainer("link")
          .add(new Label("name", Model.of(org.getName())))
          .add(new AttributeModifier("href", "#org" + org.getOrganisation_id())));
      }
    });
    add(new ListView<Organisation_Users>("orgRooms", u.getOrganisation_users()) {
      private static final long serialVersionUID = 9039932126334250798L;

      @Override
      protected void populateItem(ListItem<Organisation_Users> item) {
        Organisation org = item.getModelObject().getOrganisation();
        item.add(new RoomsPanel("rooms"
          , getBean(RoomDao.class).getOrganisationRooms(org.getOrganisation_id()))
          .setMarkupId("org" + org.getOrganisation_id())).setRenderBodyOnly(true);
      }
    });
    add(new JQueryBehavior("#orgTabs", "tabs"));
  }
View Full Code Here

  @Override
  public void submitView(AjaxRequestTarget target, List<User> usersToAdd) {
    // TODO Auto-generated method stub
    AdminUserDao userDao = Application.getBean(AdminUserDao.class);
    Organisation organisation = getModelObject();
    for (User u : usersToAdd) {
      List<Organisation_Users> orgUsers = u.getOrganisation_users();
      boolean found = false;
      for (Organisation_Users ou : orgUsers) {
        if (ou.getOrganisation().getOrganisation_id().equals(organisation.getOrganisation_id())) {
          found = true;
          break;
        }
      }
      if (!found) {
View Full Code Here

    return getModelObject().getOrganisation_id() != null ? getModelObject().getOrganisation_id() : 0;
  }
 
  @Override
  protected void onNewSubmit(AjaxRequestTarget target, Form<?> f) {
    this.setModelObject(new Organisation());
    updateView(target);
  }
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.