/** * Returns the name of the namespace that was specified by the user. If an * alias or the canonical name was used, the alias or cannonical name is * returned. The alias or name as specified in the configuration is * returned, which might differ in case from what the user specified. */ public String getNamespaceAlias() { if (namespaceAlias == null) return namespace.getName(); return namespaceAlias; }
@Override public int compareTo(Namespace o) { return ((Integer) getId()).compareTo(o.getId()); } }
@Override public Namespace getSubjectNamespaceFor(Namespace namespace) { if (namespace.isSubjectNamespace()) return namespace; return getNamespace(namespace.getSubjectspaceId()); }
@Override public Namespace getTalkNamespaceFor(Namespace namespace) { if (namespace.isTalkNamespace()) return namespace; return getNamespace(namespace.getTalkspaceId()); }
if (!lcNs.equals(namespace.getName())) for (String a : namespace.getAliases())
/** * Return true if the given link is a link to a category page */ private boolean isCategory(WtInternalLink link) { // Use config name! String categoryCanonical = "Category"; String categoryNameSpace = "Category"; if (config.getNamespace(CATEGORY_KEY) != null) { categoryNameSpace = config.getNamespace(14).getName(); categoryCanonical = config.getNamespace(14).getCanonical(); } return link.getTarget().getAsString().startsWith(categoryNameSpace) || link.getTarget().getAsString().startsWith(categoryCanonical); }
if (ns.isMediaNs()) title = title.newWithNamespace(frame.getWikiConfig().getFileNamespace());
public PageTitle getBaseTitle() { if (!namespace.isCanHaveSubpages()) return this; int i = title.lastIndexOf('/'); if (i < 0) return this; String baseTitle = title.substring(0, i); return new PageTitle( config, baseTitle, null, namespace, namespaceAlias, interwiki, initialColon, isDefaultNs); }
if (!lcNs.equals(namespace.getName())) for (String a : namespace.getAliases())
@Override public Namespace getTalkNamespaceFor(Namespace namespace) { if (namespace.isTalkNamespace()) return namespace; return getNamespace(namespace.getTalkspaceId()); }
if (ns.isMediaNs()) title = title.newWithNamespace(frame.getWikiConfig().getFileNamespace());
public PageTitle getBaseTitle() { if (!namespace.isCanHaveSubpages()) return this; int i = title.lastIndexOf('/'); if (i < 0) return this; String baseTitle = title.substring(0, i); return new PageTitle( config, baseTitle, null, namespace, namespaceAlias, interwiki, initialColon, isDefaultNs); }
/** * Returns the name of the namespace that was specified by the user. If an * alias or the canonical name was used, the alias or cannonical name is * returned. The alias or name as specified in the configuration is * returned, which might differ in case from what the user specified. */ public String getNamespaceAlias() { if (namespaceAlias == null) return namespace.getName(); return namespaceAlias; }
@Override public Namespace getSubjectNamespaceFor(Namespace namespace) { if (namespace.isSubjectNamespace()) return namespace; return getNamespace(namespace.getSubjectspaceId()); }
@Override public int compareTo(Namespace o) { return ((Integer) getId()).compareTo(o.getId()); } }
result = namespace.getName();
result = namespace.getName();
@Override protected final WtNode invoke(WtTemplate var, ExpansionFrame frame) { PageTitle title = frame.getRootFrame().getTitle(); Namespace talkNs = frame.getWikiConfig().getTalkNamespaceFor(title.getNamespace()); return nf().text(talkNs.getName()); } }