Package org.apache.openmeetings.db.entity.record

Examples of org.apache.openmeetings.db.entity.record.FlvRecording


   * @param fileExplorerItemId
   */
  public boolean delete(Long flvRecordingId) {
    try {

      FlvRecording f = get(flvRecordingId);
      return delete(f);
    } catch (Exception ex2) {
      log.error("[delete]: ", ex2);
    }

View Full Code Here


              checkRecordingFile(hibernateDir, rec.getPreviewImage(), rec.getDeleted(), params, cleanup);
            }
            long invalid = 0;
            for (File f : hibernateDir.listFiles()) {
              if (f.isFile() && f.getName().endsWith(".flv")) {
                FlvRecording rec = recordDao.getRecordingByHash(f.getName());
                if (rec == null) {
                  cleanUpFile(invalid, cleanup, f);
                  String name = f.getName().substring(0, f.getName().length() - 5);
                  cleanUpFile(invalid, cleanup, new File(hibernateDir, name + ".avi"));
                  cleanUpFile(invalid, cleanup, new File(hibernateDir, name + ".jpg"));
View Full Code Here

      }

      @Override
      protected ResourceResponse newResourceResponse(Attributes attributes) {
        ResourceResponse rr = new ResourceResponse();
        FlvRecording r = getRecording(attributes);
        if (r != null) {
          isRange = false;
          file = getFile(r);
          rr.setFileName(getFileName(r));
          rr.setContentType(RecordingResourceReference.this.getContentType());
View Full Code Here

    }
    return result;
  }
 
  private FlvRecording getRecording(Long id) {
    FlvRecording r = getBean(FlvRecordingDao.class).get(id);
    // TODO should we process public?
    // || r.getOwnerId() == 0 || r.getParentFileExplorerItemId() == null || r.getParentFileExplorerItemId() == 0
    if (r == null) {
      return r;
    }
    if (r.getOwnerId() == null || getUserId() == r.getOwnerId()) {
      return r;
    }
    if (getBean(OrganisationUserDao.class).isUserInOrganization(r.getOrganization_id(), getUserId())) {
      return r;
    }
    //TODO external group check was added for plugin recording download
    String extType = getExternalType();
    if (extType != null && extType.equals(r.getCreator().getExternalUserType())) {
      return r;
    }
    return null;
  }
View Full Code Here

      this.orgId = orgId;
      this.name = name;
    }
   
    public Iterator<? extends FlvRecording> getRoots() {
      FlvRecording r = new FlvRecording();
      r.setFlvRecordingId(-1);
      r.setOrganization_id(orgId);
      r.setOwnerId(null);
      String pub = WebSession.getString(861);
      r.setFileName(orgId == null ? pub : String.format("%s (%s)", pub, name));
      return Arrays.asList(r).iterator();
    }
View Full Code Here

    add(download);
    update(null, r);
  }
 
  public VideoInfo update(AjaxRequestTarget target, FlvRecording r) {
    rm.setObject(r == null ? new FlvRecording() : r);
    try {
      Room room = getBean(RoomDao.class).get(r.getRoom_id());
      roomName.setObject(room.getName());
    } catch (Exception e) {
      //no-op
View Full Code Here

  private static final long serialVersionUID = 1L;
  protected final WebMarkupContainer item = new WebMarkupContainer("item");

  public RecordingPanel(String id, final IModel<FlvRecording> model) {
    super(id, model);
    FlvRecording r = model.getObject();
    add(new WindowsTheme());
    item.add(r.isFolder() ? new AjaxEditableLabel<String>("name", Model.of(model.getObject().getFileName())) {
      private static final long serialVersionUID = 1L;
     
      @Override
      protected String getLabelAjaxEvent() {
        return "dblClick";
      }
     
      @Override
      protected void onSubmit(AjaxRequestTarget target) {
        super.onSubmit(target);
        FlvRecording r = model.getObject();
        r.setFileName(getEditor().getModelObject());
        getBean(FlvRecordingDao.class).update(r);
      }
     
      @Override
      public void onEdit(AjaxRequestTarget target) {
        super.onEdit(target);
      }
    } : new Label("name", r.getFileName()));
    add(item.setOutputMarkupId(true));
  }
View Full Code Here

public class RecordingPage extends BaseInitedPage {
  private static final long serialVersionUID = 1L;

  public RecordingPage(PageParameters p) {
    String hash = p.get("hash").toString();
    FlvRecording r = null;
    if (WebSession.get().signIn(hash)) {
      Long recId = getRecordingId();
      if (recId != null) {
        r = getBean(FlvRecordingDao.class).get(recId);
      }
View Full Code Here

    add(container.add(message.setVisible(false), logView.setVisible(false)).setOutputMarkupId(true));
  }
 
  @Override
  protected void onOpen(AjaxRequestTarget target) {
    FlvRecording f = getModelObject();
    List<FlvRecordingLog> logs = getBean(FlvRecordingLogDao.class).getByRecordingId(f.getFlvRecordingId());
    if (f.getFileHash() == null) {
      message.setVisible(true);
      message.setDefaultModelObject(WebSession.getString(888));
    } else if (!isRecordingExists(f.getFileHash() + MP4_EXTENSION)) {
      message.setVisible(true);
      message.setDefaultModelObject(WebSession.getString(1595));
    } else {
      message.setVisible(false);
    }
View Full Code Here

    final AddFolderDialog addFolder = new AddFolderDialog("addFolder", WebSession.getString(712)) {
      private static final long serialVersionUID = 1L;

      @Override
      protected void onSubmit(AjaxRequestTarget target) {
        FlvRecording f = new FlvRecording();
        f.setFileName(getModelObject());
        f.setInsertedBy(getUserId());
        f.setInserted(new Date());
        f.setFolder(true);
        f.setIsImage(false);
        f.setIsPresentation(false);
        f.setIsRecording(true);
        FlvRecording p = rm.getObject();
        long parentId = p.getFlvRecordingId();
        if (p.isFolder()) {
          f.setParentFileExplorerItemId(parentId);
        }
        f.setOwnerId(p.getOwnerId());
        f.setOrganization_id(p.getOrganization_id());
        getBean(FlvRecordingDao.class).update(f);
        target.add(trees); //FIXME add correct refresh
      }
    };
    add(addFolder);
    add(new WebMarkupContainer("create").add(new AjaxEventBehavior("onclick") {
      private static final long serialVersionUID = 1L;

      @Override
      protected void onEvent(AjaxRequestTarget target) {
        addFolder.open(target);
      }
    }));
    add(new WebMarkupContainer("refresh").add(new AjaxEventBehavior("onclick") {
      private static final long serialVersionUID = 1L;

      @Override
      protected void onEvent(AjaxRequestTarget target) {
        target.add(trees); //FIXME add correct refresh
      }
    }));
    ConfirmableAjaxLink trash = new ConfirmableAjaxLink("trash", 713) {
      private static final long serialVersionUID = 1L;

      @Override
      public void onClick(AjaxRequestTarget target) {
        long id = rm.getObject().getFlvRecordingId();
        if (id > 0) {
          getBean(FlvRecordingDao.class).delete(rm.getObject());
        }
        target.add(trees); //FIXME add correct refresh
      }
    };
    trash.add(new WebMarkupContainer("drop-center").setOutputMarkupId(true)).add(new DropTarget(Operation.MOVE) {
      private static final long serialVersionUID = 1L;

      @Override
      public void onDrop(AjaxRequestTarget target, Transfer transfer, Location location) throws Reject {
        FlvRecording r = transfer.getData();
        getBean(FlvRecordingDao.class).delete(r);
        target.add(trees); //FIXME add correct refresh
      }
    }.dropCenter("span"));
    add(trash/*.add(new WindowsTheme())*/); //TODO check theme here
View Full Code Here

TOP

Related Classes of org.apache.openmeetings.db.entity.record.FlvRecording

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.