Examples of subResource()


Examples of org.apache.wink.server.utils.SingleLinkBuilder.subResource()

        }

        // generate the edit link
        SingleLinkBuilder singleLinkBuilder = linkBuilders.createSingleLinkBuilder();
        if (editable) {
            singleLinkBuilder.subResource(DefectsResource.DEFECT_URL)
                .pathParam(DefectsResource.DEFECT_VAR, id).rel(AtomConstants.ATOM_REL_EDIT)
                .build(entry.getLinks());
        }

        // if this entry is not part of a history response, then generate the
View Full Code Here

Examples of org.apache.wink.server.utils.SingleLinkBuilder.subResource()

        }

        // if this entry is not part of a history response, then generate the
        // history link
        if (!history) {
            singleLinkBuilder.subResource(DefectsResource.DEFECT_HISTORY_URL)
                .pathParam(DefectsResource.DEFECT_VAR, id).rel(AtomConstants.ATOM_REL_HISTORY)
                .type(MediaType.APPLICATION_ATOM_XML_TYPE).build(entry.getLinks());
        }

        // generate system links to self and alternate.
View Full Code Here

Examples of org.apache.wink.server.utils.SingleLinkBuilder.subResource()

            builder.pathParam("id", "1").build(links);
            assertEquals(1, links.size());
            assertLink(links, null, null, "1");

            links.clear();
            builder.subResource("a/{subId}/b").pathParam("subId", "2").build(links);
            assertEquals(1, links.size());
            assertLink(links, null, null, "1/a/2/b");

            return "";
        }
View Full Code Here

Examples of org.apache.wink.server.utils.SingleLinkBuilder.subResource()

        }

        // generate the edit link
        SingleLinkBuilder singleLinkBuilder = linkBuilders.createSingleLinkBuilder();
        if (editable) {
            singleLinkBuilder.subResource(DefectsResource.DEFECT_URL)
                .pathParam(DefectsResource.DEFECT_VAR, id).rel(AtomConstants.ATOM_REL_EDIT)
                .build(entry.getLinks());
        }

        // if this entry is not part of a history response, then generate the
View Full Code Here

Examples of org.apache.wink.server.utils.SingleLinkBuilder.subResource()

        }

        // if this entry is not part of a history response, then generate the
        // history link
        if (!history) {
            singleLinkBuilder.subResource(DefectsResource.DEFECT_HISTORY_URL)
                .pathParam(DefectsResource.DEFECT_VAR, id).rel(AtomConstants.ATOM_REL_HISTORY)
                .type(MediaType.APPLICATION_ATOM_XML_TYPE).build(entry.getLinks());
        }

        // generate system links to self and alternate.
View Full Code Here

Examples of org.apache.wink.server.utils.SystemLinksBuilder.subResource()

        Map<String, String> bookmarks = BookmarkStore.getInstance().getBookmarks();

        SystemLinksBuilder entryLinksBuilder = linkBuilders.createSystemLinksBuilder();
        for (String key : bookmarks.keySet()) {
            // set the sub-resource state of the builder for this entry
            entryLinksBuilder.subResource(key);
            SyndEntry entry = createEntry(key, bookmarks.get(key), entryLinksBuilder, null);
            feed.addEntry(entry);
        }
        // generate collection links in the response
        linkBuilders.createSystemLinksBuilder().build(feed.getLinks());
View Full Code Here

Examples of org.apache.wink.server.utils.SystemLinksBuilder.subResource()

        // generate history links
        if (history) {
            // all defects in the collection are the history of the same defect
            // and they all have the
            // same defect id, so we can use the id of the first one
            systemLinksBuilder.subResource(DefectsResource.DEFECT_HISTORY_URL)
                .pathParam(DefectsResource.DEFECT_VAR, defects.get(0).getId()).build(feed
                    .getLinks());
            if (!defects.isEmpty()) {
                // if this is a history of a defect, then the last defect in the
                // list is the latest state of the defect
View Full Code Here

Examples of org.apache.wink.server.utils.SystemLinksBuilder.subResource()

        Map<String, String> bookmarks = BookmarkStore.getInstance().getBookmarks();

        SystemLinksBuilder entryLinksBuilder = linkBuilders.createSystemLinksBuilder();
        for (String key : bookmarks.keySet()) {
            // set the sub-resource state of the builder for this entry
            entryLinksBuilder.subResource(key);
            SyndEntry entry = createEntry(key, bookmarks.get(key), entryLinksBuilder, null);
            feed.addEntry(entry);
        }
        // generate collection links in the response
        linkBuilders.createSystemLinksBuilder().build(feed.getLinks());
View Full Code Here

Examples of org.apache.wink.server.utils.SystemLinksBuilder.subResource()

        // generate history links
        if (history) {
            // all defects in the collection are the history of the same defect
            // and they all have the
            // same defect id, so we can use the id of the first one
            systemLinksBuilder.subResource(DefectsResource.DEFECT_HISTORY_URL)
                .pathParam(DefectsResource.DEFECT_VAR, defects.get(0).getId()).build(feed
                    .getLinks());
            if (!defects.isEmpty()) {
                // if this is a history of a defect, then the last defect in the
                // list is the latest state of the defect
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.