use of org.xwiki.component.namespace.Namespace in project xwiki-platform by xwiki.
the class DefaultFlavorManager method getFlavorOfWiki.
@Override
public ExtensionId getFlavorOfWiki(String wikiId) {
Namespace namespace = new Namespace("wiki", wikiId);
InstalledExtension flavor = getFlavorExtension(namespace);
if (flavor != null) {
return flavor.getId();
}
return null;
}
use of org.xwiki.component.namespace.Namespace in project xwiki-platform by xwiki.
the class EntityReferenceConverter method convertToType.
private EntityReference convertToType(Type type, String value) {
Namespace namespace = NamespaceUtils.toNamespace(value);
EntityType entityType = namespace.getType() != null ? EnumUtils.getEnum(EntityType.class, namespace.getType().toUpperCase()) : null;
String entityReference = namespace.getValue();
if (entityType == null) {
entityType = EntityType.DOCUMENT;
entityReference = value;
}
return this.stringResolver.resolve(entityReference, entityType);
}
Aggregations