Creates a list item representing a redirect.<p>

@return the new list item
421665
private CmsCreatableListItem makeRedirectItem() {

        CmsNewResourceInfo typeInfo = getController().getData().getNewRedirectElementInfo();
        CmsListInfoBean info = new CmsListInfoBean();
        info.setTitle(typeInfo.getTitle());
        info.setSubTitle(Messages.get().key(Messages.GUI_REDIRECT_SUBTITLE_0));
        CmsListItemWidget widget = new CmsListItemWidget(info);
        widget.setIcon(typeInfo.getBigIconClasses());
        CmsCreatableListItem listItem = new CmsCreatableListItem(widget, typeInfo, NewEntryType.redirect);
        listItem.initMoveHandle(CmsSitemapView.getInstance().getTree().getDnDHandler());
        return listItem;
    }
270176
private CmsCreatableListItem makeNewElementItem(final CmsNewResourceInfo typeInfo) {

        CmsListItemWidget widget = new CmsListItemWidget(typeInfo);
        if ((typeInfo.getDescription() != null) && (typeInfo.getDescription().trim().length() > 0)) {
            widget.addAdditionalInfo(
                new CmsAdditionalInfoBean(
                    Messages.get().key(Messages.GUI_LABEL_DESCRIPTION_0),
                    typeInfo.getDescription(),
                    null));
        }
        if (typeInfo.getVfsPath() != null) {
            widget.addAdditionalInfo(
                new CmsAdditionalInfoBean(
                    Messages.get().key(Messages.GUI_LABEL_VFSPATH_0),
                    typeInfo.getVfsPath(),
                    null));
        }
        if (typeInfo.getDate() != null) {
            widget.addAdditionalInfo(
                new CmsAdditionalInfoBean(Messages.get().key(Messages.GUI_LABEL_DATE_0), typeInfo.getDate(), null));
        }
        CmsCreatableListItem listItem = new CmsCreatableListItem(widget, typeInfo, NewEntryType.regular);
        listItem.initMoveHandle(CmsSitemapView.getInstance().getTree().getDnDHandler(), true);
        return listItem;
    }
234594
public CmsResource createNewElement(CmsObject userCms, String pageFolderRootPath) throws CmsException {

        return createNewElement(userCms, null, pageFolderRootPath);
    }
10052
public Result redirectTemporary(String url) {
        status(Status.TEMPORARY_REDIRECT);
        with(HeaderNames.LOCATION, url);
        return this;
    }
821294
HttpRequestConfig getRedirectRequestConfig() {
        if (redirectRequestConfig == null) {
            redirectRequestConfig = HttpRequestConfig.builder().setRedirectionValidator(getRedirectionValidator()).build();
        }
        return redirectRequestConfig;
    }
533575
public CmsFileInput createFileInput() {

        // remove the current file input field and add a new one
        CmsFileInput previous = m_fileInput;
        if (m_fileInput != null) {
            m_fileInput.getElement().getStyle().setDisplay(Display.NONE);
        }
        m_fileInput = new CmsFileInput();
        m_fileInput.addChangeHandler(new ChangeHandler() {

            public void onChange(ChangeEvent event) {

                CmsDomUtil.ensureMouseOut(m_main.getElement());
                m_buttonHandler.onChange(m_fileInput);
            }
        });
        m_buttonHandler.initializeFileInput(m_fileInput);
        m_main.add(m_fileInput);
        return previous;
    }
929679
protected CmsListItem getDummyListItem(CmsHtmlList list) {

        CmsListItem item = list.newItem(CmsUUID.getNullUUID().toString());
        item.set(A_CmsListExplorerDialog.LIST_COLUMN_NAME, "");
        item.set(A_CmsListExplorerDialog.LIST_COLUMN_TITLE, "");
        item.set(A_CmsListExplorerDialog.LIST_COLUMN_TYPE, "");
        item.set(A_CmsListExplorerDialog.LIST_COLUMN_SIZE, "");
        item.set(A_CmsListExplorerDialog.LIST_COLUMN_PERMISSIONS, "");
        item.set(A_CmsListExplorerDialog.LIST_COLUMN_DATELASTMOD, new Date());
        item.set(A_CmsListExplorerDialog.LIST_COLUMN_USERLASTMOD, "");
        item.set(A_CmsListExplorerDialog.LIST_COLUMN_DATECREATE, new Date());
        item.set(A_CmsListExplorerDialog.LIST_COLUMN_USERCREATE, "");
        item.set(A_CmsListExplorerDialog.LIST_COLUMN_DATEREL, new Date());
        item.set(A_CmsListExplorerDialog.LIST_COLUMN_DATEEXP, new Date());
        item.set(A_CmsListExplorerDialog.LIST_COLUMN_STATE, "");
        item.set(A_CmsListExplorerDialog.LIST_COLUMN_LOCKEDBY, "");
        return item;
    }
35888
protected HttpClient newHttpClient() {
        return HttpClients.custom()
                // Do not manage redirection.
                .setRedirectStrategy(new DefaultRedirectStrategy() {
                    @Override
                    protected boolean isRedirectable(String method) {
                        return followRedirect(method);
                    }
                })
                .setDefaultCookieStore(new BasicCookieStore() {
                    @Override
                    public synchronized List<Cookie> getCookies() {
                        return Collections.emptyList();
                    }
                })
                .build();
    }
42925
private List<CmsSelectWidgetOption> createNavOpts(CmsSiteBean currSite) {

        List<CmsSite> sites = new ArrayList<CmsSite>();
        for (CmsSite site : OpenCms.getSiteManager().getAvailableSites(getCms(), true)) {
            if (site.getSiteMatcher() != null) {
                sites.add(site);
            }
        }

        float maxValue = 0;
        float nextPos = 0;

        // calculate value for the first navigation position
        float firstValue = 1;
        if (sites.size() > 0) {
            try {
                maxValue = sites.get(0).getPosition();
            } catch (Exception e) {
                // should usually never happen
            }
        }

        if (maxValue != 0) {
            firstValue = maxValue / 2;
        }

        List<String> options = new ArrayList<String>(sites.size() + 1);
        List<String> values = new ArrayList<String>(sites.size() + 1);

        // add the first entry: before first element
        options.add(getMessages().key(org.opencms.workplace.commons.Messages.GUI_CHNAV_POS_FIRST_0));
        values.add(firstValue + "");

        // show all present navigation elements in box
        for (int i = 0; i < sites.size(); i++) {
            String navText = sites.get(i).getTitle();
            float navPos = sites.get(i).getPosition();
            String siteRoot = sites.get(i).getSiteRoot();
            // get position of next nav element
            nextPos = navPos + 2;
            if ((i + 1) < sites.size()) {
                nextPos = sites.get(i + 1).getPosition();
            }
            // calculate new position of current nav element
            float newPos;
            if ((nextPos - navPos) > 1) {
                newPos = navPos + 1;
            } else {
                newPos = (navPos + nextPos) / 2;
            }
            // check new maxValue of positions and increase it
            if (navPos > maxValue) {
                maxValue = navPos;
            }
            // if the element is the current file, mark it in select box
            if ((currSite != null) && (currSite.getSiteRoot() != null) && currSite.getSiteRoot().equals(siteRoot)) {
                options.add(
                    CmsEncoder.escapeHtml(
                        getMessages().key(
                            org.opencms.workplace.commons.Messages.GUI_CHNAV_POS_CURRENT_1,
                            new Object[] {sites.get(i).getSiteRoot()})));
                values.add("-1");
            } else {
                options.add(CmsEncoder.escapeHtml(navText + " [" + sites.get(i).getSiteRoot() + "/]"));
                values.add(newPos + "");
            }
        }

        // add the entry: at the last position
        options.add(getMessages().key(org.opencms.workplace.commons.Messages.GUI_CHNAV_POS_LAST_0));
        values.add((maxValue + 1) + "");

        // add the entry: no change
        options.add(getMessages().key(org.opencms.workplace.commons.Messages.GUI_CHNAV_NO_CHANGE_0));
        if ((currSite != null) && (currSite.getPosition() == Float.MAX_VALUE)) {
            // current resource has no valid position, use "last position"
            values.add((maxValue + 1) + "");
        } else {
            // current resource has valid position, use "-1" for no change
            values.add("-1");
        }
        List<CmsSelectWidgetOption> result = new ArrayList<CmsSelectWidgetOption>();
        for (int i = 0; i < values.size(); i++) {
            String val = values.get(i);
            String opt = options.get(i);
            result.add(new CmsSelectWidgetOption(val, false, opt));
        }
        return result;
    }
370827
public synchronized Map<PoolInfo, PoolInfo> getRedirects() {
    return (poolInfoToRedirect == null) ? null :
        new HashMap<PoolInfo, PoolInfo>(poolInfoToRedirect);
  }
499361
@RequestMapping(value = "api/edit/server", method = RequestMethod.POST)
    public
    @ResponseBody
    ServerRedirect addRedirectToProfile(Model model,
                                        @RequestParam(value = "profileId", required = false) Integer profileId,
                                        @RequestParam(value = "profileIdentifier", required = false) String profileIdentifier,
                                        @RequestParam(value = "srcUrl", required = true) String srcUrl,
                                        @RequestParam(value = "destUrl", required = true) String destUrl,
                                        @RequestParam(value = "clientUUID", required = true) String clientUUID,
                                        @RequestParam(value = "hostHeader", required = false) String hostHeader) throws Exception {
        if (profileId == null && profileIdentifier == null) {
            throw new Exception("profileId required");
        }
        if (profileId == null) {
            profileId = ProfileService.getInstance().getIdFromName(profileIdentifier);
        }

        int clientId = ClientService.getInstance().findClient(clientUUID, profileId).getId();

        int redirectId = ServerRedirectService.getInstance().addServerRedirectToProfile("", srcUrl, destUrl, hostHeader,
                profileId, clientId);
        return ServerRedirectService.getInstance().getRedirect(redirectId);
    }
257761
@NonNull
    @Override
    public RedirectAdapter.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent,
                                                         int viewType) {
        // create a new view
        final ViewGroup pollingView = (LinearLayout) LayoutInflater.from(parent.getContext())
                .inflate(R.layout.polling_list_item, parent, false);
        return new ViewHolder(pollingView);
    }
1206350
private List<CmsUserAddInfoBean> createAddInfoList(CmsUser user) {

        List<CmsUserAddInfoBean> addInfoList = new ArrayList<CmsUserAddInfoBean>();
        // add beans
        Iterator<CmsWorkplaceUserInfoBlock> itBlocks = OpenCms.getWorkplaceManager().getUserInfoManager().getBlocks().iterator();
        while (itBlocks.hasNext()) {
            CmsWorkplaceUserInfoBlock block = itBlocks.next();
            Iterator<CmsWorkplaceUserInfoEntry> itEntries = block.getEntries().iterator();
            while (itEntries.hasNext()) {
                CmsWorkplaceUserInfoEntry entry = itEntries.next();
                Object value = user.getAdditionalInfo(entry.getKey());
                if (value == null) {
                    value = "";
                }
                addInfoList.add(new CmsUserAddInfoBean(entry.getKey(), value.toString(), entry.getClassType()));
            }
        }
        return addInfoList;
    }
130016
private CmsCreatableListItem makeNavigationLevelItem() {

        CmsNewResourceInfo typeInfo = getController().getData().getNewNavigationLevelElementInfo();
        CmsListItemWidget widget = new CmsListItemWidget(typeInfo);
        CmsCreatableListItem listItem = new CmsCreatableListItem(widget, typeInfo, NewEntryType.regular);
        listItem.initMoveHandle(CmsSitemapView.getInstance().getTree().getDnDHandler());
        return listItem;
    }
447449
public StringArray getRedirects() {
    if (Descriptor_Type.featOkTst && ((Descriptor_Type)jcasType).casFeat_redirects == null)
      jcasType.jcas.throwFeatMissing("redirects", "de.julielab.jules.types.wikipedia.Descriptor");
    return (StringArray)(jcasType.ll_cas.ll_getFSForRef(jcasType.ll_cas.ll_getRefValue(addr, ((Descriptor_Type)jcasType).casFeatCode_redirects)));}
376938
protected <T extends AppController> HttpBuilder redirect(Class<T> controllerClass){
        return redirect(controllerClass, new HashMap());

    }
531887
public String getJavaScriptForRedirect(String reqUrlCookieName, String redirectUrl, Map<String, String> cookieProperties) throws Exception {
        String javascript = createJavaScriptForRedirectCookie(reqUrlCookieName, cookieProperties) + "\n";
        javascript += createJavaScriptStringToPerformRedirect(redirectUrl) + "\n";
        return wrapInJavascriptHtmlTags(javascript);
    }