help text

@param wikiId
@param siteurl
@return - the help text
328084
public static String help(String wikiId, String siteurl) {
    File propFile = getPropertyFile(wikiId);
    String help = "Need to be able to read Credentials for \n\t" + siteurl
        + "\nfrom " + propFile.getPath() + "\n";
    help += "Please run \n";
    help += "\tjava -cp target/classes com.bitplan.mediawiki.japi.user.WikiUser "
        + wikiId + "\n";
    help += "to create it. Then restart your tests.";
    return help;
  }
1295674
protected void site(String cmd) {
        int firstSpace = cmd.indexOf(' ');
        if(firstSpace < 0) firstSpace = cmd.length();

        CommandInfo info = siteCommands.get(cmd.substring(0, firstSpace).toUpperCase());

        if(info == null) {
            sendResponse(504, "Unknown site command");
            return;
        }

        processCommand(info, firstSpace != cmd.length() ? cmd.substring(firstSpace + 1) : "");
    }
1363414
public function getConsentTextForWebsite($consentUrl, $websiteId)
    {
        if (! isset($this->consentText[$websiteId])) {
            $this->consentText[$websiteId] = $this->configHelper->getConsentSubscriberText($websiteId);
        }
        $consentText = $this->consentText[$websiteId];

        if (! isset($this->customerConsentText[$websiteId])) {
            $this->customerConsentText[$websiteId] = $this->configHelper->getConsentCustomerText($websiteId);
        }
        $customerConsentText = $this->customerConsentText[$websiteId];

        //customer checkout and registration if consent text not empty
        if ($this->isLinkMatchCustomerRegistrationOrCheckout($consentUrl) && strlen($customerConsentText)) {
            $consentText = $customerConsentText;
        }

        return $consentText;
    }
940871
private static SitelinkFeedItem createSiteLinkFeedItem(String sitelinkText, String sitelinkUrl) {
    SitelinkFeedItem sitelinkFeedItem = new SitelinkFeedItem();
    sitelinkFeedItem.setSitelinkText(sitelinkText);
    sitelinkFeedItem.setSitelinkFinalUrls(new UrlList(new String[] {sitelinkUrl}));
    return sitelinkFeedItem;
  }
534476
protected Content getNavLinkHelp() {
        String helpfile = configuration.helpfile;
        DocPath helpfilenm;
        if (helpfile.isEmpty()) {
            helpfilenm = DocPaths.HELP_DOC;
        } else {
            DocFile file = DocFile.createFileForInput(configuration, helpfile);
            helpfilenm = DocPath.create(file.getName());
        }
        Content linkContent = getHyperLink(pathToRoot.resolve(helpfilenm),
                helpLabel, "", "");
        Content li = HtmlTree.LI(linkContent);
        return li;
    }
1052149
public void setWikipedia(String wikipedia) {
    if(wikipedia != null) {
      wikipedia = wikipedia.trim();
    }
    this.wikipedia = wikipedia;
  }
889564
function _createSync(siteId) {
  const ttxSettings = config.getConfig('ttxSettings');
  const syncUrl = (ttxSettings && ttxSettings.syncUrl) || SYNC_ENDPOINT;

  return {
    type: 'iframe',
    url: `${syncUrl}&id=${siteId}`
  }
}
979066
def webhelp(i):
    
    a=i.get('repo_uoa','')
    m=i.get('module_uoa','')
    duoa=i.get('data_uoa','')

    url=cfg['wiki_data_web']

    if m!='':
       if duoa=='': 
          duoa=m
          m=cfg['module_name']

       r=find_path_to_data({'repo_uoa':a, 'module_uoa':m, 'data_uoa':duoa})
       if r['return']>0: return r
       p=r['path']

       rx=convert_entry_to_cid(r)
       if rx['return']>0: return rx

       cuoa=rx['cuoa']
       cid=rx['cid']
       xcuoa=rx['xcuoa']
       xcid=rx['xcid']

       # Prepare URL
       url+=cid.replace(':','_')

    out('Opening web page '+url+' ...')

    import webbrowser
    webbrowser.open(url)

    return {'return':0}
496666
def _parse_wikilink(self):
        """"""
        reset = self._head + 1
        self._head += 2
        try:
            # If the wikilink looks like an external link, parse it as such:
            link, extra, delta = self._really_parse_external_link(True)
        except BadRoute:
            self._head = reset + 1
            try:
                # Otherwise, actually parse it as a wikilink:
                wikilink = self._parse(contexts.WIKILINK_TITLE)
            except BadRoute:
                self._head = reset
                self._emit_text("[[")
            else:
                self._emit(tokens.WikilinkOpen())
                self._emit_all(wikilink)
                self._emit(tokens.WikilinkClose())
        else:
            if self._context & contexts.EXT_LINK_TITLE:
                # In this exceptional case, an external link that looks like a
                # wikilink inside of an external link is parsed as text:
                self._head = reset
                self._emit_text("[[")
                return
            self._emit_text("[")
            self._emit(tokens.ExternalLinkOpen(brackets=True))
            self._emit_all(link)
            self._emit(tokens.ExternalLinkClose())
966919
public void generate()
		throws WikiApiException
	{
		Indexer data = null;
		try {
			data = new Indexer(config);

			System.out.println("GENERATING INDEX STARTED");

			long bufferSize = config.getBufferSize();
			Revision rev;
			long count = 0;
			long last = 0, now, start = System.currentTimeMillis();

			Iterator<Revision> it = new IndexIterator(config);
			while (it.hasNext()) {

				if (++count % bufferSize == 0) {
					now = System.currentTimeMillis() - start;
					System.out.println(Time.toClock(now) + "\t" + (now - last)
							+ "\tINDEXING " + count);
					last = now;
				}

				rev = it.next();
				data.index(rev);
			}

			System.out.println("GENERATING INDEX ENDED + ("
					+ Time.toClock(System.currentTimeMillis() - start) + ")");

		}
		catch (Exception e) {

			throw new WikiApiException(e);

		}
		finally {
			if (data != null) {
				data.close();
			}
		}
	}
1329724
public static String defaultHelpHtml(String helpId, String helpText) {

        StringBuffer html = new StringBuffer(1024);
        if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(helpText)) {
            html.append("<div class='help' id='help");
            html.append(helpId);
            html.append("' onMouseOut=\"hMH('");
            html.append(helpId);
            html.append("');\">");
            html.append(helpText);
            html.append("</div>\n");
        }
        return html.toString();
    }
218148
protected String buildHtmlHelpNavigation() {

        StringBuffer result = new StringBuffer(512);
        // determine current URI
        String currentUri = getParamHelpresource();
        // ignore ressources outside content folder: e.g. the search.html which
        // is in the general help module and not the german or english online help folder.
        if ((currentUri == null) || (currentUri.indexOf("/workplace/locales/") == -1)) {
            // BUG!: getLocale().getLanguage() -> getCms().getRequestContext().getLocale() returns "en"!
            //currentUri = "/system/workplace/locales/" + getLocale().getLanguage() + "/help/";
            currentUri = resolveMacros(PATH_HELP) + DEFAULT_HELPFILE;
        }
        // determine level of help start folder
        int helpLevel = CmsResource.getPathLevel(PATH_HELP);

        // get a list of all pages / subfolders in the help folder
        List<CmsJspNavElement> navList = getJsp().getNavigation().getNavigationTreeForFolder(currentUri, helpLevel, 99);
        Iterator<CmsJspNavElement> i = navList.iterator();

        while (i.hasNext()) {
            CmsJspNavElement nav = i.next();
            // calculate level to display
            int level = nav.getNavTreeLevel() - (helpLevel - 1);
            if (nav.getResourceName().equals(currentUri)
                || (nav.isFolderLink() && currentUri.equals(nav.getResourceName() + "index.html"))) {
                result.append("\t\t<span class=\"navhelpcurrent\" style=\"padding-left: ");
                result.append(level * 10);
                result.append("px; background-position: ");
                result.append((level - 1) * 10);
                result.append("px 1px;\">");
                result.append(nav.getNavText());
                result.append("</span><br style=\"clear:left\">\n");
            } else {
                result.append("\t\t<a class=\"navhelp\" style=\"padding-left: ");
                result.append(level * 10);
                result.append("px; background-position: ");
                result.append((level - 1) * 10);
                result.append("px 1px;\" href=\"");
                if (nav.isFolderLink()) {
                    // append file name to folder links to avoid static export issues
                    result.append(
                        getJsp().link(
                            "/system/modules/org.opencms.workplace.help/jsptemplates/help_body.jsp?helpresource="
                                + nav.getResourceName()
                                + "index.html&"
                                + CmsLocaleManager.PARAMETER_LOCALE
                                + "="
                                + getLocale()));
                } else {
                    result.append(getJsp().link(
                        "/system/modules/org.opencms.workplace.help/jsptemplates/help_body.jsp?helpresource="
                            + nav.getResourceName()
                            + "&"
                            + CmsLocaleManager.PARAMETER_LOCALE
                            + "="
                            + getLocale()));
                    //                    result.append(getJsp().link(nav.getResourceName()));
                }
                result.append("\">");
                result.append(nav.getNavText());
                result.append("</a><br style=\"clear:left\">\n");
            }
        }
        return result.toString();
    }
1012629
public String getWikipediaId() {
        StringBuilder sb = new StringBuilder();
        sb.append(this.getDatabaseConfiguration().getHost());
        sb.append("_");
        sb.append(this.getDatabaseConfiguration().getDatabase());
        sb.append("_");
        sb.append(this.getDatabaseConfiguration().getLanguage());
        return sb.toString();
    }
782715
public int getPageIdForRevisionId(final int revisionID)
        throws WikiApiException
    {

        try {
            if (revisionID < 1) {
                throw new IllegalArgumentException();
            }

            int pageId = -1;

            PreparedStatement statement = null;
            ResultSet result = null;

            try {
                statement = this.connection.prepareStatement("SELECT r.ArticleID "
                        + "FROM revisions as r, index_revisionID as idx "
                        + "WHERE idx.RevisionID=? AND idx.RevisionPK=r.PrimaryKey LIMIT 1");
                statement.setInt(1, revisionID);
                result = statement.executeQuery();

                if (result.next()) {
                    pageId = result.getInt(1);
                }
                else {
                    throw new WikiPageNotFoundException("The revision with the ID " + revisionID
                            + " was not found.");
                }

            }
            finally {
                if (statement != null) {
                    statement.close();
                }
                if (result != null) {
                    result.close();
                }
            }

            return pageId;

        }
        catch (WikiPageNotFoundException e) {
            throw e;
        }
        catch (Exception e) {
            throw new WikiApiException(e);
        }
    }
392378
public static void main(String[] args) throws IOException, PageNotFoundException {
    if (args.length != 1) {
      System.out.println("Usage: " + WikipediaQuickCheck.class.getName() + " <url>");
      System.exit(1);
    }
    WikipediaQuickCheck check = new WikipediaQuickCheck();
    // URL examples:
    //String urlString = "http://de.wikipedia.org/wiki/Angela_Merkel";
    //String urlString = "https://de.wikipedia.org/wiki/Benutzer_Diskussion:Dnaber";
    //String urlString = "https://secure.wikimedia.org/wikipedia/de/wiki/Gütersloh";
    String urlString = args[0];
    MarkupAwareWikipediaResult result = check.checkPage(new URL(urlString), new ErrorMarker("***", "***"));
    int errorCount = 0;
    for (AppliedRuleMatch match : result.getAppliedRuleMatches()) {
      RuleMatchApplication matchApplication = match.getRuleMatchApplications().get(0);
      RuleMatch ruleMatch = match.getRuleMatch();
      Rule rule = ruleMatch.getRule();
      System.out.println("");
      String message = ruleMatch.getMessage().replace("<suggestion>", "'").replace("</suggestion>", "'");
      errorCount++;
      System.out.print(errorCount + ". " + message);
      if (rule instanceof AbstractPatternRule) {
        System.out.println(" (" + ((AbstractPatternRule) rule).getFullId() + ")");
      } else {
        System.out.println(" (" + rule.getId() + ")");
      }
      System.out.println("    ..." + matchApplication.getOriginalErrorContext(50).replace("\n", "\\n") + "...");
    }
  }
328983
public String getHtmlHelpIcon(String id, String pathPrefix) {

        String value = m_htmlProps.getProperty("C_HELP_IMG");
        if (value == null) {
            return "";
        } else {
            value = CmsStringUtil.substitute(value, "$replace$", id);
            return CmsStringUtil.substitute(value, "$path$", pathPrefix);
        }
    }
734590
public void setSiteUrl(String siteUrl) {
        this.siteUrl = StringUtils.isBlank(siteUrl) ? new ServerSiteUrlConfig() : new ServerSiteUrlConfig(siteUrl);
    }