Search in sources :

Example 11 with DialogButton

use of com.googlecode.wicket.jquery.ui.widget.dialog.DialogButton 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
        }
    });
}
Also used : WebClientInfo(org.apache.wicket.protocol.http.request.WebClientInfo) DialogButton(com.googlecode.wicket.jquery.ui.widget.dialog.DialogButton) EmptyPanel(org.apache.wicket.markup.html.panel.EmptyPanel) OmWebSocketPanel(org.apache.openmeetings.web.common.OmWebSocketPanel) WsClient(org.apache.openmeetings.db.entity.basic.WsClient) IWsClient(org.apache.openmeetings.db.entity.basic.IWsClient) ConnectedMessage(org.apache.wicket.protocol.ws.api.message.ConnectedMessage) MessageDialog(com.googlecode.wicket.jquery.ui.widget.dialog.MessageDialog) StringValue(org.apache.wicket.util.string.StringValue) Room(org.apache.openmeetings.db.entity.room.Room) IWsClient(org.apache.openmeetings.db.entity.basic.IWsClient) JQueryBehavior(com.googlecode.wicket.jquery.core.JQueryBehavior) VideoSettings(org.apache.openmeetings.web.room.VideoSettings) Invitation(org.apache.openmeetings.db.entity.room.Invitation) OmAjaxClientInfoBehavior(org.apache.openmeetings.web.common.OmAjaxClientInfoBehavior) IPartialPageRequestHandler(org.apache.wicket.core.request.handler.IPartialPageRequestHandler) FastDateFormat(org.apache.commons.lang3.time.FastDateFormat) AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) WebSession(org.apache.openmeetings.web.app.WebSession) NetTestPanel(org.apache.openmeetings.web.room.NetTestPanel) Recording(org.apache.openmeetings.db.entity.record.Recording)

Example 12 with DialogButton

use of com.googlecode.wicket.jquery.ui.widget.dialog.DialogButton in project openmeetings by apache.

the class InvitationPasswordDialog method onInitialize.

@Override
protected void onInitialize() {
    getTitle().setObject(getString("230"));
    password.setLabel(Model.of(getString("110")));
    check = new DialogButton("check", getString("537"));
    super.onInitialize();
}
Also used : DialogButton(com.googlecode.wicket.jquery.ui.widget.dialog.DialogButton)

Example 13 with DialogButton

use of com.googlecode.wicket.jquery.ui.widget.dialog.DialogButton in project openmeetings by apache.

the class RegisterDialog method onInitialize.

@Override
protected void onInitialize() {
    getTitle().setObject(getString("113"));
    cancelBtn = new DialogButton("cancel", getString("lbl.cancel"));
    registerBtn = new DialogButton("register", getString("121")) {

        private static final long serialVersionUID = 1L;

        @Override
        public boolean isIndicating() {
            return true;
        }
    };
    confirmRegistration = new NonClosableMessageDialog("confirmRegistration", getString("235"), getString("warn.notverified")) {

        private static final long serialVersionUID = 1L;

        @Override
        public void onClose(IPartialPageRequestHandler handler, DialogButton button) {
            s.open(handler);
        }
    };
    add(confirmRegistration);
    reset(null);
    super.onInitialize();
}
Also used : DialogButton(com.googlecode.wicket.jquery.ui.widget.dialog.DialogButton) NonClosableMessageDialog(org.apache.openmeetings.web.util.NonClosableMessageDialog) IPartialPageRequestHandler(org.apache.wicket.core.request.handler.IPartialPageRequestHandler)

Example 14 with DialogButton

use of com.googlecode.wicket.jquery.ui.widget.dialog.DialogButton in project openmeetings by apache.

the class ResetPasswordDialog method onInitialize.

@Override
protected void onInitialize() {
    getTitle().setObject(getString("325"));
    resetBtn = new DialogButton("reset", getString("327"));
    add(form);
    confirmReset = new NonClosableMessageDialog("confirmReset", getString("325"), getString("332")) {

        private static final long serialVersionUID = 1L;

        @Override
        public void onClose(IPartialPageRequestHandler handler, DialogButton button) {
            setResponsePage(Application.get().getSignInPageClass());
        }
    };
    add(confirmReset);
    super.onInitialize();
}
Also used : DialogButton(com.googlecode.wicket.jquery.ui.widget.dialog.DialogButton) NonClosableMessageDialog(org.apache.openmeetings.web.util.NonClosableMessageDialog) IPartialPageRequestHandler(org.apache.wicket.core.request.handler.IPartialPageRequestHandler)

Example 15 with DialogButton

use of com.googlecode.wicket.jquery.ui.widget.dialog.DialogButton in project openmeetings by apache.

the class NameDialog method onInitialize.

@Override
protected void onInitialize() {
    setTitle(Model.of(getTitleStr()));
    add = new DialogButton("add", getAddStr());
    cancel = new DialogButton("cancel", getString("lbl.cancel"));
    form.add(new Label("label", getLabelStr()), title = new RequiredTextField<>("title", getModel()), feedback.setOutputMarkupId(true), new // FAKE button so "submit-on-enter" works as expected
    AjaxButton(// FAKE button so "submit-on-enter" works as expected
    "submit") {

        private static final long serialVersionUID = 1L;

        @Override
        protected void onSubmit(AjaxRequestTarget target) {
            NameDialog.this.onSubmit(target);
        }

        @Override
        protected void onError(AjaxRequestTarget target) {
            NameDialog.this.onError(target);
        }
    });
    title.setLabel(Model.of(getLabelStr()));
    add(form.setOutputMarkupId(true));
    super.onInitialize();
}
Also used : AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) DialogButton(com.googlecode.wicket.jquery.ui.widget.dialog.DialogButton) Label(org.apache.wicket.markup.html.basic.Label) RequiredTextField(org.apache.wicket.markup.html.form.RequiredTextField)

Aggregations

DialogButton (com.googlecode.wicket.jquery.ui.widget.dialog.DialogButton)26 IPartialPageRequestHandler (org.apache.wicket.core.request.handler.IPartialPageRequestHandler)10 MessageDialog (com.googlecode.wicket.jquery.ui.widget.dialog.MessageDialog)6 AjaxRequestTarget (org.apache.wicket.ajax.AjaxRequestTarget)5 NonClosableMessageDialog (org.apache.openmeetings.web.util.NonClosableMessageDialog)3 JQueryBehavior (com.googlecode.wicket.jquery.core.JQueryBehavior)2 Room (org.apache.openmeetings.db.entity.room.Room)2 PrivateMessage (org.apache.openmeetings.db.entity.user.PrivateMessage)2 Component (org.apache.wicket.Component)2 WebMarkupContainer (org.apache.wicket.markup.html.WebMarkupContainer)2 EmptyPanel (org.apache.wicket.markup.html.panel.EmptyPanel)2 JSONObject (com.github.openjson.JSONObject)1 Droppable (com.googlecode.wicket.jquery.ui.interaction.droppable.Droppable)1 WysiwygEditor (com.googlecode.wicket.jquery.ui.plugins.wysiwyg.WysiwygEditor)1 DefaultWysiwygToolbar (com.googlecode.wicket.jquery.ui.plugins.wysiwyg.toolbar.DefaultWysiwygToolbar)1 Calendar (java.util.Calendar)1 FastDateFormat (org.apache.commons.lang3.time.FastDateFormat)1 StrongPasswordValidator (org.apache.openmeetings.core.util.StrongPasswordValidator)1 IWsClient (org.apache.openmeetings.db.entity.basic.IWsClient)1 WsClient (org.apache.openmeetings.db.entity.basic.WsClient)1