Package org.apache.jackrabbit.spi.commons.namespace

Examples of org.apache.jackrabbit.spi.commons.namespace.NamespaceResolver


    private RepositoryService rs;

    protected void setUp() throws Exception {
        super.setUp();
        rs = helper.getRepositoryService();
                NamespaceResolver nsResolver = new AbstractNamespaceResolver() {
            public String getURI(String prefix) throws NamespaceException {
                return ("jcr".equals(prefix)) ? "http://www.jcp.org/jcr/1.0" : prefix;
            }
            public String getPrefix(String uri) throws NamespaceException {
                return ("http://www.jcp.org/jcr/1.0".equals(uri)) ? "jcr" : uri;
View Full Code Here


    protected void setUp() throws Exception {
        super.setUp();

        rs = helper.getRepositoryService();
        si = helper.getAdminSessionInfo();
        NamespaceResolver nsResolver = new AbstractNamespaceResolver() {
            public String getURI(String prefix) throws NamespaceException {
                return ("jcr".equals(prefix)) ? "http://www.jcp.org/jcr/1.0" : prefix;
            }
            public String getPrefix(String uri) throws NamespaceException {
                return ("http://www.jcp.org/jcr/1.0".equals(uri)) ? "jcr" : uri;
View Full Code Here

    protected void setUp() throws Exception {
        super.setUp();
        rs = helper.getRepositoryService();
        si = helper.getAdminSessionInfo();

        NamespaceResolver nsResolver = new AbstractNamespaceResolver() {
            public String getURI(String prefix) throws NamespaceException {
                return ("jcr".equals(prefix)) ? "http://www.jcp.org/jcr/1.0" : prefix;
            }
            public String getPrefix(String uri) throws NamespaceException {
                return ("http://www.jcp.org/jcr/1.0".equals(uri)) ? "jcr" : uri;
View Full Code Here

        private final NameResolver nResolver;
        private final PathResolver pResolver;

        private NamePathResolverImpl(SessionInfo sessionInfo) {
            NamespaceResolver nsResolver = new NamespaceResolverImpl(sessionInfo);
            nResolver = new ParsingNameResolver(getNameFactory(), nsResolver);
            IdentifierResolver idResolver = new IdentifierResolverImpl(sessionInfo);
            pResolver = new ParsingPathResolver(getPathFactory(), nResolver, idResolver);
        }
View Full Code Here

                    NameFactory nameFactory, PathFactory pathFactory) throws RepositoryException {
        this.session = session;
        this.credentials = credentials;

        final NamespaceRegistry nsReg = session.getWorkspace().getNamespaceRegistry();
        final NamespaceResolver nsResolver = new NamespaceResolver() {
            public String getPrefix(String uri) throws NamespaceException {
                try {
                    return nsReg.getPrefix(uri);
                }
                catch (RepositoryException e) {
View Full Code Here

     * @return default value
     */
    private String getDefaultValue(PropDef def, int index) {
        try {
            InternalValue[] values = def.getDefaultValues();
            NamespaceResolver nsResolver = new AdditionalNamespaceResolver(registry);
            NamePathResolver resolver = new DefaultNamePathResolver(nsResolver);
            return values[index].toJCRValue(resolver).getString();
        } catch (RepositoryException e) {
            throw new AssertionFailedError(e.getMessage());
        }
View Full Code Here

    protected void setUp() throws Exception {
        super.setUp();
        factory = PathFactoryImpl.getInstance();

        NamespaceResolver nsresolver = new NamespaceResolver() {
            public String getURI(String prefix) throws NamespaceException {
                throw new UnsupportedOperationException();
            }
            public String getPrefix(String uri) throws NamespaceException {
                if (uri.equals(Name.NS_JCR_URI)) {
View Full Code Here

            }
        }
    }

    public void testExpandedJcrNames() throws NamespaceException, IllegalNameException {
        NamespaceResolver resolver = new TestNamespaceResolver();

        List valid = new ArrayList();
        // valid qualified jcr-names:
        // String-array consisting of { jcrName , uri , localName }
        valid.add(new String[] {"abc:{c}", "abc", "{c}"});
View Full Code Here

    protected void setUp() throws Exception {
        super.setUp();

        valueFactory = QValueFactoryImpl.getInstance();
        resolver = new DefaultNamePathResolver(new NamespaceResolver () {
            public String getURI(String prefix) throws NamespaceException {
                return prefix;
            }
            public String getPrefix(String uri) throws NamespaceException {
                return uri;
View Full Code Here

    private NameResolver resolver;
    private PrivilegeRegistry privilegeRegistry;

    protected void setUp() throws Exception {
        super.setUp();
        NamespaceResolver nsResolver = new NamespaceResolver() {
            public String getURI(String prefix) throws NamespaceException {
                if (Name.NS_JCR_PREFIX.equals(prefix)) {
                    return Name.NS_JCR_URI;
                } else if (Name.NS_EMPTY_PREFIX.equals(prefix)) {
                    return Name.NS_DEFAULT_URI;
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.spi.commons.namespace.NamespaceResolver

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.