Examples of AppWorkspace


Examples of org.apache.wink.common.model.app.AppWorkspace

        // to relevant Workspace
        for (ServiceDocumentCollectionData serviceDocumentCollection : collectionList) {

            // get workspace
            String workspaceName = serviceDocumentCollection.getWorkspace();
            AppWorkspace workspace = workspaces.get(workspaceName);

            if (workspace == null) {

                // Create new workspace
                workspace = new AppWorkspace();
                AtomText workspaceTitle = new AtomText();

                // Set workspace title
                workspaceTitle.setValue(workspaceName);
                workspace.setTitle(workspaceTitle);
                workspaces.put(workspaceName, workspace);

                // Add workspace to list of workspaces
                workspaceList.add(workspace);
            }
View Full Code Here

Examples of org.apache.wink.common.model.app.AppWorkspace

            AppService service =
                resource.accept(MediaTypeUtils.ATOM_SERVICE_DOCUMENT).get(AppService.class);

            // Find workspace by it's title
            AppWorkspace workspace = service.getWorkspace(WORKSPACE_TITLE);

            // Find collection by title
            AppCollection collection = workspace.getCollection(COLLECTION_TITLE);
            String href = collection.getHref();

            // Get collection of defects
            Resource feedResource = restClient.resource(href);
            AtomFeed feed = feedResource.accept(MediaType.APPLICATION_ATOM_XML).get(AtomFeed.class);
View Full Code Here

Examples of org.apache.wink.common.model.app.AppWorkspace

        // to relevant Workspace
        for (ServiceDocumentCollectionData serviceDocumentCollection : collectionList) {

            // get workspace
            String workspaceName = serviceDocumentCollection.getWorkspace();
            AppWorkspace workspace = workspaces.get(workspaceName);

            if (workspace == null) {

                // Create new workspace
                workspace = new AppWorkspace();
                AtomText workspaceTitle = new AtomText();

                // Set workspace title
                workspaceTitle.setValue(workspaceName);
                workspace.setTitle(workspaceTitle);
                workspaces.put(workspaceName, workspace);

                // Add workspace to list of workspaces
                workspaceList.add(workspace);
            }
View Full Code Here

Examples of org.apache.wink.common.model.app.AppWorkspace

                                                        MediaTypeUtils.ATOM_SERVICE_DOCUMENT_TYPE);
        MockHttpServletResponse response = invoke(request);
        assertEquals("status", HttpStatus.OK.getCode(), response.getStatus());
        String contentString = response.getContentAsString();
        AppService service = AppService.unmarshal(new StringReader(contentString));
        AppWorkspace workspace = service.getWorkspace().get(0);
        AppCollection collection = workspace.getCollection().get(0);
        String href = collection.getHref();
        assertTrue("ipv6 URI: " + href, href.startsWith(http));
    }
View Full Code Here

Examples of org.apache.wink.common.model.app.AppWorkspace

        request.setSecure(true);
        MockHttpServletResponse response = invoke(request);
        assertEquals("status", HttpStatus.OK.getCode(), response.getStatus());
        String contentString = response.getContentAsString();
        AppService service = AppService.unmarshal(new StringReader(contentString));
        AppWorkspace workspace = service.getWorkspace().get(0);
        AppCollection collection = workspace.getCollection().get(0);
        String href = collection.getHref();
        assertTrue("ipv6 URI: " + href, href.startsWith(https));
    }
View Full Code Here

Examples of org.apache.wink.common.model.app.AppWorkspace

    private void assertWorkspaces(List<AppWorkspace> expectedWorkspaces,
                                  List<AppWorkspace> workspaces) {
        assertEquals(expectedWorkspaces.size(), workspaces.size());
        for (int i = 0; i < expectedWorkspaces.size(); ++i) {
            AppWorkspace expectedWorkspace = expectedWorkspaces.get(i);
            AppWorkspace workspace = workspaces.get(i);

            assertEquals(expectedWorkspace.getLang(), workspace.getLang());
            assertEquals(expectedWorkspace.getBase(), workspace.getBase());
            assertEquals(expectedWorkspace.getTitle().getType(), workspace.getTitle().getType());
            assertEquals(expectedWorkspace.getTitle().getValue(), workspace.getTitle().getValue());
            assertEquals(expectedWorkspace.getOtherAttributes()
                .get(new QName("anyAttirbCollection")), workspace.getOtherAttributes()
                .get(new QName("anyAttirbCollection")));

            assertNotNull(workspace.getCollection("collection1"));
            assertNotNull(workspace.getCollection("collection2"));
            assertNull(workspace.getCollection("collection3"));

            assertCollections(expectedWorkspace.getCollection(), workspace.getCollection());
        }

    }
View Full Code Here

Examples of org.apache.wink.common.model.app.AppWorkspace

        service.getWorkspace();
        return service;
    }

    private AppWorkspace getWorkspace(String id) {
        AppWorkspace ws = new AppWorkspace();
        ws.setLang("en-us");
        ws.setBase("http://base/workspace");
        ws.setTitle(new AtomText("workspace" + id));
        ws.getOtherAttributes().put(new QName("anyAttirbWorkspace"), "anyAttribValueWorkspace");

        ws.getCollection().add(getCollection("1"));
        ws.getCollection().add(getCollection("2"));

        return ws;
    }
View Full Code Here

Examples of org.jboss.resteasy.plugins.providers.atom.app.AppWorkspace

        marshaller.setProperty(Marshaller.JAXB_FRAGMENT, Boolean.FALSE);
        marshaller.setProperty(Marshaller.JAXB_ENCODING, "UTF-8");

        AppService service = new AppService();

        AppWorkspace workspace1 = new AppWorkspace();
        workspace1.setTitle("Main Site");
        AppCollection collection1 = new AppCollection();
        collection1.setHref("http://example.org/blog/main");
        collection1.setTitle("My Blog Entries");
        AppCategories categories1 = new AppCategories();
        categories1.setHref("http://example.com/cats/forMain.cats");
        collection1.getCategories().add(categories1);
        workspace1.getCollection().add(collection1);

        AppCollection collection2 = new AppCollection();
        collection2.setHref("http://example.org/blog/pic");
        collection2.setTitle("Pictures");
        AppAccept accept1 = new AppAccept();
        accept1.setContent("image/png");
        collection2.getAccept().add(accept1);
        AppAccept accept2 = new AppAccept();
        accept2.setContent("image/jpg");
        collection2.getAccept().add(accept2);
        AppAccept accept3 = new AppAccept();
        accept3.setContent("image/gif");
        collection2.getAccept().add(accept3);
        workspace1.getCollection().add(collection2);

        service.getWorkspace().add(workspace1);

        AppWorkspace workspace2 = new AppWorkspace();
        workspace1.setTitle("Sidebar Blog");
        AppCollection collection3 = new AppCollection();
        collection3.setHref("http://example.org/sidebar/list");
        collection3.setTitle("Remaindered Links");
        AppAccept accept4 = new AppAccept();
        accept4.setContent("application/atom+xml;type=entry");
        collection3.getAccept().add(accept4);
        AppCategories categories3 = new AppCategories();
        categories3.setFixed(true);
        Category category1 = new Category();
        category1.setScheme(new URI("http://example.org/extra-cats/"));
        category1.setTerm("joke");
        categories3.getCategory().add(category1);
        Category category2 = new Category();
        category2.setScheme(new URI("http://example.org/extra-cats/"));
        category2.setTerm("serious");
        categories3.getCategory().add(category2);

        collection3.getCategories().add(categories3);
        workspace2.getCollection().add(collection3);

        service.getWorkspace().add(workspace2);

        StringWriter writer = new StringWriter();
        JAXBElement<AppService> element = new JAXBElement<AppService>(
View Full Code Here

Examples of org.jboss.resteasy.plugins.providers.atom.app.AppWorkspace

    /**
     * Create an instance of {@link AppWorkspace }
     *
     */
    public AppWorkspace createAppWorkspace() {
        return new AppWorkspace();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.