use of org.apache.jackrabbit.spi.commons.conversion.NameResolver in project jackrabbit by apache.
the class EventState method setupCachingPathResolver.
private static void setupCachingPathResolver() {
if (cachingPathResolver != null) {
return;
}
PathResolver pathResolver = new ParsingPathResolver(PathFactoryImpl.getInstance(), new NameResolver() {
public Name getQName(String name) throws IllegalNameException, NamespaceException {
return null;
}
public String getJCRName(Name name) throws NamespaceException {
return name.getLocalName();
}
});
cachingPathResolver = new CachingPathResolver(pathResolver);
}
use of org.apache.jackrabbit.spi.commons.conversion.NameResolver in project jackrabbit by apache.
the class ACLTemplateTest method testGetRestrictionTypes.
public void testGetRestrictionTypes() throws RepositoryException {
JackrabbitAccessControlList acl = createEmptyTemplate(getTestPath());
NameResolver resolver = (NameResolver) superuser;
assertEquals(PropertyType.PATH, acl.getRestrictionType(resolver.getJCRName(ACLTemplate.P_NODE_PATH)));
assertEquals(PropertyType.STRING, acl.getRestrictionType(resolver.getJCRName(ACLTemplate.P_GLOB)));
}
use of org.apache.jackrabbit.spi.commons.conversion.NameResolver in project jackrabbit by apache.
the class ACLTemplateTest method testGetRestrictionNames.
public void testGetRestrictionNames() throws RepositoryException {
List<String> names = Arrays.asList(createEmptyTemplate(getTestPath()).getRestrictionNames());
assertEquals(2, names.size());
NameResolver resolver = (NameResolver) superuser;
assertTrue(names.contains(resolver.getJCRName(ACLTemplate.P_NODE_PATH)));
assertTrue(names.contains(resolver.getJCRName(ACLTemplate.P_GLOB)));
}
use of org.apache.jackrabbit.spi.commons.conversion.NameResolver in project jackrabbit by apache.
the class AuthorizableImplTest method setUp.
@Override
protected void setUp() throws Exception {
super.setUp();
if (superuser instanceof SessionImpl) {
NameResolver resolver = (SessionImpl) superuser;
protectedUserProps.add(resolver.getJCRName(UserConstants.P_PASSWORD));
protectedUserProps.add(resolver.getJCRName(UserConstants.P_IMPERSONATORS));
protectedUserProps.add(resolver.getJCRName(UserConstants.P_PRINCIPAL_NAME));
protectedUserProps.add(resolver.getJCRName(UserConstants.P_DISABLED));
protectedGroupProps.add(resolver.getJCRName(UserConstants.P_MEMBERS));
protectedGroupProps.add(resolver.getJCRName(UserConstants.P_PRINCIPAL_NAME));
} else {
throw new NotExecutableException();
}
}
use of org.apache.jackrabbit.spi.commons.conversion.NameResolver in project jackrabbit by apache.
the class NodeTypeImplTest method setUp.
@Override
protected void setUp() throws Exception {
super.setUp();
ntMgr = superuser.getWorkspace().getNodeTypeManager();
NodeType nt = ntMgr.getNodeType(testNodeType);
if (nt instanceof NodeTypeImpl) {
nodeType = (NodeTypeImpl) nt;
} else {
cleanUp();
throw new NotExecutableException("NodeTypeImpl expected.");
}
if (superuser instanceof NameResolver) {
resolver = (NameResolver) superuser;
} else {
cleanUp();
throw new NotExecutableException();
}
}
Aggregations