use of org.apache.openmeetings.db.entity.record.Recording in project openmeetings by apache.
the class VideoInfo method update.
public VideoInfo update(AjaxRequestTarget target, BaseFileItem _r) {
boolean reConvEnabled = false;
boolean exists = false;
if (_r instanceof Recording) {
Recording r = (Recording) _r;
rm.setObject(r);
exists = r.exists();
try {
String name = null;
if (r.getRoomId() != null) {
Room room = roomDao.get(r.getRoomId());
if (room != null) {
name = room.getName();
isInterview = Room.Type.interview == room.getType();
}
}
roomName.setObject(name);
} catch (Exception e) {
// no-op
}
if (r.getOwnerId() != null && r.getOwnerId().equals(getUserId()) && r.getStatus() != Status.RECORDING && r.getStatus() != Status.CONVERTING) {
List<RecordingMetaData> metas = metaDao.getByRecording(r.getId());
for (RecordingMetaData meta : metas) {
if (r.getRoomId() == null || !getRecordingMetaData(r.getRoomId(), meta.getStreamName()).exists()) {
break;
}
}
reConvEnabled = !metas.isEmpty();
}
}
reConvert.setEnabled(reConvEnabled);
downloadBtn.setEnabled(exists && !_r.isReadOnly());
share.setEnabled(exists && !_r.isReadOnly());
if (target != null) {
target.add(form);
}
return this;
}
use of org.apache.openmeetings.db.entity.record.Recording in project openmeetings by apache.
the class VideoPlayer method update.
public VideoPlayer update(AjaxRequestTarget target, BaseFileItem r) {
boolean videoExists = r != null && r.exists();
if (videoExists) {
PageParameters pp = new PageParameters();
if (r instanceof Recording) {
pp.add("id", r.getId());
mp4Rec.setPageParameters(pp);
player.replace(mp4Rec);
player.setPoster(posterRecRes, pp);
} else {
pp.add("id", r.getId()).add("uid", findParent(MainPanel.class).getClient().getUid());
mp4File.setPageParameters(pp);
player.replace(mp4File);
player.setPoster(posterFileRes, new PageParameters(pp).add("preview", true));
}
}
container.setVisible(videoExists);
if (target != null) {
target.add(container);
}
return this;
}
use of org.apache.openmeetings.db.entity.record.Recording in project openmeetings by apache.
the class HashPage method onInitialize.
@Override
protected void onInitialize() {
super.onInitialize();
StringValue secure = p.get(HASH);
StringValue invitation = p.get(INVITATION_HASH);
WebSession ws = WebSession.get();
ws.checkHashes(secure, invitation);
String errorMsg = getString("invalid.hash");
recContainer.setVisible(false);
add(new EmptyPanel(PANEL_MAIN).setVisible(false));
if (!invitation.isEmpty()) {
Invitation i = ws.getInvitation();
if (i == null) {
errorMsg = getString("error.hash.invalid");
} else if (!i.isAllowEntry()) {
FastDateFormat sdf = FormatHelper.getDateTimeFormat(i.getInvitee());
errorMsg = Valid.OneTime == i.getValid() ? getString("error.hash.used") : String.format("%s %s - %s, %s", getString("error.hash.period"), sdf.format(i.getValidFrom()), sdf.format(i.getValidTo()), i.getInvitee().getTimeZoneId());
} else {
Recording rec = i.getRecording();
if (rec != null) {
vi.setVisible(!i.isPasswordProtected());
vp.setVisible(!i.isPasswordProtected());
if (!i.isPasswordProtected()) {
vi.update(null, rec);
vp.update(null, rec);
}
recContainer.setVisible(true);
error = false;
}
Room r = i.getRoom();
if (r != null && !r.isDeleted()) {
createRoom(r.getId());
if (i.isPasswordProtected() && rp != null) {
mp.getChat().setVisible(false);
rp.setOutputMarkupPlaceholderTag(true).setVisible(false);
}
}
}
} else if (!secure.isEmpty()) {
Long recId = getRecordingId(), roomId = ws.getRoomId();
if (recId == null && roomId == null) {
errorMsg = getString("1599");
} else if (recId != null) {
recContainer.setVisible(true);
Recording rec = recDao.get(recId);
vi.update(null, rec);
vp.update(null, rec);
error = false;
} else {
createRoom(roomId);
}
}
StringValue swf = p.get(SWF);
StringValue app = swf.isEmpty() ? p.get(APP) : swf;
if (!app.isEmpty()) {
if (APP_TYPE_NETWORK.equals(app.toString())) {
replace(new NetTestPanel(PANEL_MAIN).add(AttributeModifier.append("class", "app")));
error = false;
}
if (APP_TYPE_SETTINGS.equals(app.toString())) {
replace(new VideoSettings(PANEL_MAIN).replace(new OmWebSocketPanel("ws-panel") {
private static final long serialVersionUID = 1L;
private WsClient c = null;
@Override
protected void onConnect(ConnectedMessage message) {
c = new WsClient(message.getSessionId(), message.getKey().hashCode());
}
@Override
protected IWsClient getWsClient() {
return c;
}
}).add(new OmAjaxClientInfoBehavior() {
private static final long serialVersionUID = 1L;
@Override
protected void onClientInfo(AjaxRequestTarget target, WebClientInfo info) {
super.onClientInfo(target, info);
target.appendJavaScript(String.format("VideoSettings.init(%s);VideoSettings.open();", VideoSettings.getInitJson("noclient")));
}
}));
error = false;
}
}
add(recContainer.add(vi.setShowShare(false).setOutputMarkupPlaceholderTag(true), vp.setOutputMarkupPlaceholderTag(true)), new InvitationPasswordDialog("i-pass", this));
remove(urlParametersReceivingBehavior);
add(new MessageDialog("access-denied", getString("invalid.hash"), errorMsg, DialogButtons.OK, DialogIcon.ERROR) {
private static final long serialVersionUID = 1L;
@Override
public void onConfigure(JQueryBehavior behavior) {
super.onConfigure(behavior);
behavior.setOption("autoOpen", error);
behavior.setOption("resizable", false);
}
@Override
public void onClose(IPartialPageRequestHandler handler, DialogButton button) {
// no-op
}
});
}
use of org.apache.openmeetings.db.entity.record.Recording in project openmeetings by apache.
the class FileTreePanel method createFolder.
public void createFolder(AjaxRequestTarget target, String name) {
BaseFileItem p = lastSelected;
boolean isRecording = p instanceof Recording;
BaseFileItem f = isRecording ? new Recording() : new FileItem();
f.setName(name);
f.setHash(UUID.randomUUID().toString());
f.setInsertedBy(getUserId());
f.setInserted(new Date());
f.setType(Type.Folder);
f.setOwnerId(p.getOwnerId());
f.setGroupId(p.getGroupId());
f.setRoomId(p.getRoomId());
f.setParentId(Type.Folder == p.getType() ? p.getId() : null);
if (isRecording) {
recDao.update((Recording) f);
} else {
fileDao.update((FileItem) f);
}
update(target);
}
use of org.apache.openmeetings.db.entity.record.Recording in project openmeetings by apache.
the class OmTreeProvider method getByParent.
public List<BaseFileItem> getByParent(BaseFileItem node, Long id) {
List<BaseFileItem> list = new ArrayList<>();
if (node instanceof Recording) {
Recording rec = (Recording) node;
List<Recording> _list;
if (id == null) {
if (node.getOwnerId() == null) {
_list = recDao.getRootByPublic(rec.getGroupId());
} else {
_list = recDao.getRootByOwner(node.getOwnerId());
}
} else {
_list = recDao.getByParent(id);
}
list.addAll(_list);
} else {
List<FileItem> _list;
if (id == null) {
if (node.getRoomId() != null) {
_list = fileDao.getByRoom(node.getRoomId());
} else if (node.getGroupId() != null) {
_list = fileDao.getByGroup(node.getGroupId(), roomId == null ? VIDEO_TYPES : null);
} else {
_list = fileDao.getByOwner(node.getOwnerId());
}
} else {
_list = fileDao.getByParent(id, roomId == null ? VIDEO_TYPES : null);
}
list.addAll(_list);
}
if (node.isReadOnly()) {
for (BaseFileItem f : list) {
f.setReadOnly(true);
}
}
return list;
}
Aggregations