Package org.apache.abdera.protocol.server.impl

Examples of org.apache.abdera.protocol.server.impl.DefaultProvider


            .addRoute("categories", "/atom/:collection/:entry;categories", TargetType.TYPE_CATEGORIES)
            .addRoute("osSearch1", "/search1", OpenSearchTargetTypes.OPENSEARCH_URL)
            .addRoute("osSearch2", "/search2", OpenSearchTargetTypes.OPENSEARCH_URL)
            .addRoute("osSearch3", "/search3", OpenSearchTargetTypes.OPENSEARCH_URL);

        DefaultProvider provider = new DefaultProvider("/");
        provider.setWorkspaceManager(wsManager);
        provider.setTargetResolver(routeManager);
        provider.setTargetBuilder(routeManager);
        provider.addRequestProcessors(processors);

        this.server.start(provider);
    }
View Full Code Here


                                                                                TargetType.TYPE_COLLECTION)
            .addRoute("entry", "/atom/:collection/:entry", TargetType.TYPE_ENTRY)
            .addRoute("categories", "/atom/:collection/:entry;categories", TargetType.TYPE_CATEGORIES)
            .addRoute("osDescription", "/search", OpenSearchTargetTypes.OPENSEARCH_DESCRIPTION);

        DefaultProvider provider = new DefaultProvider("/");
        provider.setWorkspaceManager(wsManager);
        provider.setTargetResolver(routeManager);
        provider.setTargetBuilder(routeManager);
        provider.addRequestProcessors(processors);

        this.server.start(provider);
    }
View Full Code Here

            SimpleWorkspaceInfo wi = new SimpleWorkspaceInfo();
            wi.setTitle("Employee Directory Workspace");
            wi.addCollection(ca);

            DefaultProvider provider = new DefaultProvider("/");
            provider.addWorkspace(wi);

            provider.init(getAbdera(), null);
            return provider;
        }
View Full Code Here

                                                                                TargetType.TYPE_COLLECTION)
            .addRoute("entry", "/atom/:collection/:entry", TargetType.TYPE_ENTRY)
            .addRoute("categories", "/atom/:collection/:entry;categories", TargetType.TYPE_CATEGORIES)
            .addRoute("osSearch1", "/search1", OpenSearchTargetTypes.OPENSEARCH_URL);

        DefaultProvider provider = new DefaultProvider("/");
        provider.setWorkspaceManager(wsManager);
        provider.setTargetResolver(routeManager);
        provider.setTargetBuilder(routeManager);
        provider.addRequestProcessors(processors);

        this.server.start(provider);
    }
View Full Code Here

    private Server server;
    private DefaultProvider customerProvider;

    private void setupAbdera(String base) throws Exception {
        customerProvider = new DefaultProvider(base);

        CustomerAdapter ca = new CustomerAdapter();
        ca.setHref("customers");

        SimpleWorkspaceInfo wi = new SimpleWorkspaceInfo();
View Full Code Here

        server = new Server(9002);
        Context root = new Context(server, contextPath, Context.NO_SESSIONS);
        root.addServlet(new ServletHolder(new AbderaServlet() {
            @Override
            protected Provider createProvider() {
                DefaultProvider provider = new DefaultProvider("/");
                provider.addRequestProcessors(new HashMap<TargetType, RequestProcessor>() {
                    {
                        put(TargetType.TYPE_SERVICE, new MultipartRelatedServiceRequestProcessor());
                    }
                });

                MultipartRelatedAdapter ca = new MultipartRelatedAdapter();
                ca.setHref("media");

                SimpleWorkspaceInfo wi = new SimpleWorkspaceInfo();
                wi.setTitle("multimedia/related Workspace");
                wi.addCollection(ca);

                provider.addWorkspace(wi);

                provider.init(getAbdera(), null);
                return provider;
            }
        }), "/*");
        server.start();
    }
View Full Code Here

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

    jcrProvider = new DefaultProvider();

    repository = new TransientRepository();
   
    JcrCollectionAdapter cp = new JcrCollectionAdapter();
    cp.setTitle("My Entries");
View Full Code Here

  private Server server;
  private DefaultProvider customerProvider;

  private void setupAbdera(String base) throws Exception {
    customerProvider = new DefaultProvider(base);

    CustomerAdapter ca = new CustomerAdapter();
    ca.setHref("customers");

    SimpleWorkspaceInfo wi = new SimpleWorkspaceInfo();
View Full Code Here

public class ProviderDefinitionParserTest
    extends AbstractDependencyInjectionSpringContextTests {

  @Test
    public void testParser() throws Exception {
        DefaultProvider p = (DefaultProvider) applicationContext.getBean(Provider.class.getName());
       
        Resolver<Target> tresolver = p.getTargetResolver();
        assertTrue(tresolver instanceof RegexTargetResolver);
       
        WorkspaceManager wm = p.getWorkspaceManager();
       
        Collection<WorkspaceInfo> workspaces = wm.getWorkspaces(null);
        assertEquals(1, workspaces.size());
       
        WorkspaceInfo w = workspaces.iterator().next();
        assertNotNull(w);
        assertEquals("Foo Workspace", w.getTitle(null));
       
        Collection<CollectionInfo> collections = w.getCollections(null);
        assertEquals(2, collections.size());
       
        assertEquals(2, p.getFilters(null).length); //Parameter isn't used
    }
View Full Code Here

    private Resolver<Target> targetResolver;
    private Resolver<Subject> subjectResolver;
    private Filter[] filters;
   
    public Object getObject() throws Exception {
        DefaultProvider p = null;
       
        if (base != null) {
            Constructor<? extends DefaultProvider> constructor =
              providerClass.getConstructor(String.class);
            p = constructor.newInstance(base);
        } else {
            p = providerClass.newInstance();
        }
       
        if (workspaces != null && workspaces.size() > 0) {
            p.addWorkspaces(workspaces);
        }
        if (targetResolver != null) {
            p.setTargetResolver(targetResolver);
        }
       
        if (subjectResolver != null) {
            p.setSubjectResolver(subjectResolver);
        }
        if (filters != null && filters.length > 0) {
            p.addFilter(filters);
        }
       
        return p;
    }
View Full Code Here

TOP

Related Classes of org.apache.abdera.protocol.server.impl.DefaultProvider

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.