Package info.bliki.wiki.namespaces.INamespace

Examples of info.bliki.wiki.namespaces.INamespace.INamespaceValue


     * @return the (normalised) name of the page
     */
    protected static String getFullpagename(String parameter, IWikiModel model) {
        String[] fullPage = getPagenameHelper2(parameter, model);
        if (fullPage != null) {
            INamespaceValue namespace = model.getNamespace().getNamespace(fullPage[0]);
            if (namespace == null) {
                return fullPage[1];
            } else {
                return namespace.makeFullPagename(fullPage[1]);
            }
        } else {
            return "";
        }
    }
View Full Code Here


     * @return the name of the talkpage
     */
    protected static String getSubjectpage(String parameter, IWikiModel model) {
        String[] fullPage = getPagenameHelper2(parameter, model);
        if (fullPage != null) {
            INamespaceValue subjectSpace = model.getNamespace().getContentspace(fullPage[0]);
            if (subjectSpace == null) {
                return fullPage[1];
            } else {
                return subjectSpace.makeFullPagename(fullPage[1]);
            }
        } else {
            return "";
        }
    }
View Full Code Here

     * @return the name of the talkpage
     */
    protected static String getTalkpage(String parameter, IWikiModel model) {
    String[] fullPage = getPagenameHelper2(parameter, model);
        if (fullPage != null) {
            INamespaceValue talkSpace = model.getNamespace().getTalkspace(fullPage[0]);
            if (talkSpace == null) {
                return fullPage[1];
            } else {
                return talkSpace.makeFullPagename(fullPage[1]);
            }
        } else {
            return "";
        }
    }
View Full Code Here

     *            the model being used
     *
     * @return the talkspace
     */
    protected static String getTalkspace(String parameter, IWikiModel model) {
        INamespaceValue namespace = getNamespaceHelper(parameter, model);
        if (namespace != null) {
            return namespace.getTalkspace().toString();
        } else {
            return "";
        }
    }
View Full Code Here

     *            the model being used
     *
     * @return the subjectspace
     */
    protected static String getSubjectSpace(String parameter, IWikiModel model) {
        INamespaceValue namespace = getNamespaceHelper(parameter, model);
        if (namespace != null) {
            return namespace.getContentspace().toString();
        } else {
            return "";
        }
    }
View Full Code Here

     *            the model being used
     *
     * @return the extracted namespace or <tt>""</tt> if the parameter was empty
     */
    protected static String getNamespace(String parameter, IWikiModel model) {
        INamespaceValue namespace = getNamespaceHelper(parameter, model);
        if (namespace != null) {
            return namespace.toString();
        } else {
            return "";
        }
    }
View Full Code Here

        }

        int indx = pagename.indexOf(':');
        if (indx > 0) {
            String maybeNamespaceStr0 = pagename.substring(0, indx);
            INamespaceValue maybeNamespace = wikiModel.getNamespace().getNamespace(maybeNamespaceStr0);
            if (maybeNamespace != null) {
                return new ParsedPageName(maybeNamespace, pagename.substring(indx + 1), true);
            } else if (magicWordAllowed) {
                // no namespace? maybe a magic word with a parameter?
                magicWord = wikiModel.getMagicWord(maybeNamespaceStr0);
View Full Code Here

             *
             * @param name String
             * @return mixed An integer if $text is a valid value otherwise false
             */
            public LuaValue call(LuaValue name) {
                INamespaceValue ns = wikiModel.getNamespace().getNamespace(name.tojstring());
                if (ns != null) {
                    return LuaValue.valueOf(ns.getCode().code);
                } else {
                    return FALSE;
                }
            }
        };
View Full Code Here

    }

    private LuaTable namespaces() {
        LuaTable table = new LuaTable();
        for (INamespace.NamespaceCode code : INamespace.NamespaceCode.values()) {
            INamespaceValue namespaceValue = wikiModel.getNamespace().getNamespaceByNumber(code);
            table.set(code.code, luaDataForNamespace(namespaceValue));
        }
        return table;
    }
View Full Code Here

        if (result != null) {
            // found magic word template
            return result;
        }
        String articleName = parsedPagename.pagename;
        INamespaceValue namespace = parsedPagename.namespace;
        String name = encodeTitleToUrl(articleName, true);
        if (namespace == null) {
            return db.get(name);
        } else {
            return db.get(namespace + ":" + name);
View Full Code Here

TOP

Related Classes of info.bliki.wiki.namespaces.INamespace.INamespaceValue

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.