Search in sources :

Example 6 with Namespace

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;
}
Also used : InstalledExtension(org.xwiki.extension.InstalledExtension) Namespace(org.xwiki.component.namespace.Namespace)

Example 7 with Namespace

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);
}
Also used : EntityType(org.xwiki.model.EntityType) Namespace(org.xwiki.component.namespace.Namespace)

Aggregations

Namespace (org.xwiki.component.namespace.Namespace)7 InstalledExtension (org.xwiki.extension.InstalledExtension)4 ExtensionId (org.xwiki.extension.ExtensionId)2 EntityType (org.xwiki.model.EntityType)2 ArrayList (java.util.ArrayList)1 ComponentManager (org.xwiki.component.manager.ComponentManager)1 RecordableEventDescriptor (org.xwiki.eventstream.RecordableEventDescriptor)1 UntypedRecordableEventDescriptor (org.xwiki.eventstream.UntypedRecordableEventDescriptor)1 WikiNamespace (org.xwiki.model.namespace.WikiNamespace)1 EntityReference (org.xwiki.model.reference.EntityReference)1 WikiDescriptorManager (org.xwiki.wiki.descriptor.WikiDescriptorManager)1 WikiManagerException (org.xwiki.wiki.manager.WikiManagerException)1