Opens the principal select dialog within an embedded dialog context.<p>

@param dialogContext the dialog context
@param params the request parameters
@param includeWebOus include WebOu?
764138
public static void openEmbeddedDialog(
        final CmsEmbeddedDialogContext dialogContext,
        Map<String, String[]> params,
        boolean includeWebOus) {

        String[] param = params.get(PARAM_OU);
        String ou;
        if ((param != null) && (param.length >= 1)) {
            ou = param[0];
        } else {
            ou = dialogContext.getCms().getRequestContext().getCurrentUser().getOuFqn();
        }
        boolean realOnly;
        param = params.get(PARAM_REAL_ONLY);
        if ((param != null) && (param.length >= 1)) {
            realOnly = Boolean.parseBoolean(param[0]);
        } else {
            realOnly = true;
        }
        WidgetType type = WidgetType.groupwidget;
        param = params.get(PARAM_TYPE);
        if ((param != null) && (param.length >= 1)) {
            try {
                type = WidgetType.valueOf(param[0]);
            } catch (Exception e) {
                // ignore
            }
        }
        WidgetType startType = null;
        param = params.get(PARAM_START_TYPE);
        if ((param != null) && (param.length >= 1)) {
            try {
                startType = WidgetType.valueOf(param[0]);
            } catch (Exception e) {
                // ignore
            }
        }
        if (startType == null) {
            startType = type != WidgetType.principalwidget ? type : WidgetType.groupwidget;
        }
        Window window = CmsBasicDialog.prepareWindow(DialogWidth.max);
        dialogContext.setWindow(window);
        CmsPrincipalSelectDialog dialog = new CmsPrincipalSelectDialog(
            null,
            ou,
            window,
            type,
            realOnly,
            startType,
            includeWebOus);
        dialog.setSelectHandler(new I_PrincipalSelectHandler() {

            public void onPrincipalSelect(String principalType, String principalName) {

                dialogContext.setPrincipal(principalName);
            }
        });
        window.setCaption(
            CmsVaadinUtils.getMessageText(
                org.opencms.workplace.commons.Messages.GUI_PRINCIPALSELECTION_LIST_ACTION_SELECT_NAME_0));
        window.setContent(dialog);
        A_CmsUI.get().addWindow(window);
    }
539794
function(title, message, choices, defaultChoice) {
            return Dialogs.open(null, {
                "title": title,
                "message": message,
                "dialog": "select",
                "default": defaultChoice,
                "choices": choices,
                "autoFocus": true,
                "valueSelector": "selectorPrompt"
            });
        }
946496
protected void openEditLoginMessageDialog() {

        Window window = CmsBasicDialog.prepareWindow();
        CmsBasicDialog dialog = new CmsEditLoginView(window);
        window.setContent(dialog);
        window.setCaption(CmsVaadinUtils.getMessageText(Messages.GUI_MESSAGES_LOGINMESSAGE_TOOL_NAME_0));
        dialog.setWindowMinFullHeight(500);
        A_CmsUI.get().addWindow(window);
    }
572853
void launchAddFederationDialog() {
        ResourceDescription resourceDescription = StaticResourceDescription
                .from(PICKET_LINK_RESOURCES.newFederationDescription());
        ComboBoxItem securityDomains = new ComboBoxItem("security-domain", "Security Domain");
        securityDomains.setRequired(false);
        securityDomains.setValueMap(this.securityDomains);

        DefaultWindow dialog = new DefaultWindow(Console.MESSAGES.newTitle("Federation"));
        ModelNodeFormBuilder.FormAssets assets = new ModelNodeFormBuilder()
                .setResourceDescription(resourceDescription)
                .addFactory("security-domain", attributeDescription -> securityDomains)
                .setSecurityContext(securityContext)
                .unsorted()
                .build();
        assets.getForm().setEnabled(true);
        assets.getForm().addFormValidator(new IdentityProviderEditor.IdentityProviderFormValidator());

        DialogueOptions options = new DialogueOptions(
                event -> {
                    FormValidation validation = assets.getForm().validate();
                    if (!validation.hasErrors()) {
                        dialog.hide();

                        ModelNode payload = assets.getForm().getUpdatedEntity();
                        String name = payload.get(NAME).asString();
                        String ip = payload.get("identity-provider").asString();

                        Operation addFederation = new Operation.Builder(ADD,
                                FEDERATION_TEMPLATE.resolve(statementContext, name)).build();
                        Operation addIdentityProvider = new Operation.Builder(ADD,
                                IDENTITY_PROVIDER_TEMPLATE.resolve(statementContext, name, ip))
                                .param("security-domain", payload.get("security-domain").asString())
                                .param("external", payload.get("external").asBoolean())
                                .param("url", payload.get("url").asString())
                                .build();
                        dispatcher.execute(new DMRAction(new Composite(addFederation, addIdentityProvider)),
                                new SimpleCallback<DMRResponse>() {
                                    @Override
                                    public void onFailure(final Throwable caught) {
                                        super.onFailure(caught);
                                        readFederations();
                                    }

                                    @Override
                                    public void onSuccess(final DMRResponse dmrResponse) {
                                        Console.info(Console.MESSAGES.successfullyAdded((name)));
                                        readFederations();
                                    }
                                });
                    }
                },
                event -> dialog.hide()
        );

        VerticalPanel layout = new VerticalPanel();
        layout.setStyleName("fill-layout-width window-content");
        ContentDescription text = new ContentDescription(resourceDescription.get(DESCRIPTION).asString());
        layout.add(text);
        layout.add(assets.getHelp().asWidget());
        layout.add(assets.getForm().asWidget());

        ScrollPanel scroll = new ScrollPanel(layout);
        LayoutPanel content = new LayoutPanel();
        content.addStyleName("fill-layout");
        content.add(scroll);
        content.add(options);
        content.getElement().setAttribute("style", "margin-bottom:10px");
        content.setWidgetTopHeight(scroll, 0, Style.Unit.PX, 92, Style.Unit.PCT);
        content.setWidgetBottomHeight(options, 0, Style.Unit.PX, 35, Style.Unit.PX);

        dialog.setWidth(640);
        dialog.setHeight(480);
        dialog.setWidget(new TrappedFocusPanel(content));
        dialog.setGlassEnabled(true);
        dialog.center();
    }
1257976
@SuppressWarnings("unchecked")
	public OptionsBuilder includes(String... includes) {
		return includes != null ? includes(Arrays.asList(includes)) : this;
	}
231296
protected void openGalleryDialog() {

        if (m_popup == null) {
            m_popup = createPopup();
            m_popup.center();
        } else {
            if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(getCurrentElement())) {
                m_popup.searchElement(getCurrentElement());
            } else {
                m_popup.center();
            }
        }
    }
391968
private void startupDialog(String prefs, int message, final Class clazz) {
        final SharedPreferences preferences = getSharedPreferences(prefs, Activity.MODE_PRIVATE);
        final String accepted = "accepted";
        if (!preferences.getBoolean(accepted, false)) {
            AlertDialog.Builder builder = new AlertDialog.Builder(Samples.this);
            builder.setTitle("Warning");
            builder.setMessage(message);
            builder.setPositiveButton(R.string.startup_dontshowagain, new DialogInterface.OnClickListener() {
                @Override
                public void onClick(DialogInterface dialog, int which) {
                    preferences.edit().putBoolean(accepted, true).apply();
                    startActivity(new Intent(Samples.this, clazz));
                }
            });
            builder.show();
        } else {
            startActivity(new Intent(Samples.this, clazz));
        }
    }
825340
public void openStandAloneFormEditor(final CmsEditorContext context) {

        initEventPreviewHandler();
        final CmsContentDefinition definition;
        try {
            definition = (CmsContentDefinition)CmsRpcPrefetcher.getSerializedObjectFromDictionary(
                getService(),
                I_CmsContentService.DICT_CONTENT_DEFINITION);
        } catch (SerializationException e) {
            RootPanel.get().add(new Label(e.getMessage()));
            return;
        }
        m_isStandAlone = true;
        if (definition.isModelInfo()) {
            openModelSelectDialog(context, definition);
        } else {
            CmsCoreProvider.get().lock(
                CmsContentDefinition.entityIdToUuid(definition.getEntityId()),
                new I_CmsSimpleCallback<Boolean>() {

                    public void execute(Boolean arg) {

                        if (arg.booleanValue()) {

                            registerContentDefinition(definition);
                            // register all external widgets
                            WidgetRegistry.getInstance().registerExternalWidgets(
                                definition.getExternalWidgetConfigurations(),
                                new Command() {

                                    public void execute() {

                                        initEditor(context, definition, null, false, null);
                                    }
                                });

                        } else {
                            showLockedResourceMessage();
                        }
                    }
                });
        }
    }
300777
public static void openEditConfirmDialog(final CmsNewResourceInfo resourceInfo) {

        I_CmsConfirmDialogHandler handler = new I_CmsConfirmDialogHandler() {

            public void onClose() {

                // noop
            }

            public void onOk() {

                String resourcePath = resourceInfo.getVfsPath();
                String siteRoot = CmsCoreProvider.get().getSiteRoot();
                if (resourcePath.startsWith(siteRoot)) {
                    resourcePath = resourcePath.substring(siteRoot.length());
                    // prepend slash if necessary
                    if (!resourcePath.startsWith("/")) {
                        resourcePath = "/" + resourcePath;
                    }
                }
                CmsSitemapController controller = CmsSitemapView.getInstance().getController();
                controller.leaveEditor(resourcePath);
            }
        };
        String dialogTitle = Messages.get().key(Messages.GUI_EDIT_MODELPAGE_CONFIRM_TITLE_0);
        String dialogContent = Messages.get().key(Messages.GUI_EDIT_MODELPAGE_CONFIRM_CONTENT_0);
        String buttonText = Messages.get().key(Messages.GUI_EDIT_MODELPAGE_OK_0);

        CmsConfirmDialog dialog = new CmsConfirmDialog(dialogTitle, dialogContent);
        dialog.getOkButton().setText(buttonText);
        dialog.setHandler(handler);
        dialog.center();
    }
81888
protected void initContextParam(XmlParser.Node node)
    {
        String name=node.getString("param-name",false,true);
        String value=node.getString("param-value",false,true);
        if(log.isDebugEnabled())
            log.debug("ContextParam: "+name+"="+value);
        getWebApplicationContext().setInitParameter(name,value);
    }
1147167
public void openElementsInfo() {

        CmsResourceInfoDialog.load(
            CmsCoreProvider.get().getStructureId(),
            true,
            CmsContainerpageController.get().getData().getDetailId(),
            new HashMap<String, String>(),
            new CloseHandler<PopupPanel>() {

                public void onClose(CloseEvent<PopupPanel> event) {

                    deactivateCurrentButton();
                    activateSelection();
                }

            });
    }
910308
protected void openDialog() {

        CmsCreateModelPageDialog dialog = new CmsCreateModelPageDialog(
            CmsSitemapView.getInstance().getController(),
            m_isModelGroup);
        dialog.center();
    }
382318
public static void show(DialogControl<?> control) {
        DialogResponse<?> response = control.getLastResponse();
        
        if (response != null) {
            control.callback(response);
            return;
        }
        
        Window root = null;
        
        try {
            Map<String, Object> args = Collections.singletonMap("control", control);
            root = (Window) PageUtil
                    .createPage(DialogConstants.RESOURCE_PREFIX + "promptDialog.fsp", ExecutionContext.getPage(), args)
                    .get(0);
            root.modal(null);
        } catch (Exception e) {
            log.error("Error Displaying Dialog", e);
            
            if (root != null) {
                root.destroy();
            }
            
            throw MiscUtil.toUnchecked(e);
        }
    }
765661
protected void openDialog(I_CmsGalleryConfiguration configuration) {

        Document.get().getBody().addClassName(I_CmsButton.ButtonData.WAND_BUTTON.getIconClass());
        if (m_dialog == null) {
            SimplePanel tabsContainer = new SimplePanel();
            tabsContainer.addStyleName(I_CmsLayoutBundle.INSTANCE.containerpageCss().menuTabContainer());
            int dialogHeight = CmsToolbarPopup.getAvailableHeight();
            int dialogWidth = CmsToolbarPopup.getAvailableWidth();
            m_dialog = createDialog(configuration, new I_CmsGalleryHandler() {

                public boolean filterDnd(CmsResultItemBean resultBean) {

                    return CmsGwtConstants.TYPE_IMAGE.equals(resultBean.getType());
                }

                public Widget getAdditionalTypeTabControl() {

                    return null;
                }

                public I_CmsAutoHider getAutoHideParent() {

                    return getPopup();
                }

                public CmsDNDHandler getDndHandler() {

                    return CmsContainerpageController.get().getDndHandler();
                }

                public void processResultItem(CmsResultListItem item) {

                    item.setData(DND_MARKER);
                    item.setDndHelperClass("imagedrag");
                    item.setDndParentClass(
                        "imageparent "
                            + org.opencms.ade.galleries.client.ui.css.I_CmsLayoutBundle.INSTANCE.galleryResultItemCss().tilingList());
                    //item.setDragHelperTransformer(DRAG_HELPER_TRANSFORMER);
                }

            });
            m_dialog.setDialogSize(dialogWidth, dialogHeight);
            getPopup().setWidth(dialogWidth);
            tabsContainer.add(m_dialog);
            m_contentPanel.add(tabsContainer);
        } else {
            int dialogWidth = CmsToolbarPopup.getAvailableWidth();
            getPopup().setWidth(dialogWidth);
            m_dialog.truncate("GALLERY_DIALOG_TM", dialogWidth);
            m_dialog.updateSizes();
        }
    }
990461
protected void openPopup() {

        if (m_cmsPopup == null) {

            m_cmsPopup = new CmsPopup(Messages.get().key(Messages.GUI_DIALOG_CATEGORIES_TITLE_0), CmsPopup.WIDE_WIDTH);
            m_cmsCategoryTree = new CmsCategoryTree(m_selected, 300, m_isSingleValue, m_resultList, m_collapsed);
            m_cmsPopup.add(m_cmsCategoryTree);
            m_cmsPopup.setModal(false);
            m_cmsPopup.setAutoHideEnabled(true);
            m_cmsPopup.addCloseHandler(new CloseHandler<PopupPanel>() {

                public void onClose(CloseEvent<PopupPanel> event) {

                    closePopup();

                }
            });
            m_cmsPopup.addDialogClose(new Command() {

                public void execute() {

                    // do nothing all will done in onClose();
                }
            });
        }
        if (m_previewHandlerRegistration != null) {
            m_previewHandlerRegistration.removeHandler();
        }
        m_previewHandlerRegistration = Event.addNativePreviewHandler(new CloseEventPreviewHandler());
        m_cmsCategoryTree.truncate("CATEGORIES", CmsPopup.WIDE_WIDTH - 20);
        m_cmsPopup.showRelativeTo(m_categoryField);
        m_xcoordspopup = m_cmsPopup.getPopupLeft();
        m_ycoordspopup = m_cmsPopup.getPopupTop();
    }
608843
public void showPublishDialog() {

        CmsPublishDialog.showPublishDialog(new HashMap<String, String>(), new CloseHandler<PopupPanel>() {

            /**
             * @see com.google.gwt.event.logical.shared.CloseHandler#onClose(com.google.gwt.event.logical.shared.CloseEvent)
             */
            public void onClose(CloseEvent<PopupPanel> event) {

                deactivateCurrentButton();

            }
        }, new Runnable() {

            public void run() {

                showPublishDialog();
            }

        }, null);
    }
868798
protected static void setDirectEditProviderParams(PageContext context, CmsDirectEditParams params) {

        // set the direct edit params as attribute to the request
        context.getRequest().setAttribute(I_CmsDirectEditProvider.ATTRIBUTE_DIRECT_EDIT_PROVIDER_PARAMS, params);
    }