Package org.apache.wink.common.model.synd

Examples of org.apache.wink.common.model.synd.SyndContent


        }

        // serialize the defect xml
        String contentString =
            ProviderUtils.writeToString(providers, test, MediaType.APPLICATION_XML_TYPE);
        entry.setContent(new SyndContent(contentString, MediaType.APPLICATION_XML, false));

        if (!child) {
            entry.setBase(uriInfo.getAbsolutePath().toString());
        }
View Full Code Here


    }

    @Consumes
    public void setSyndEntry(SyndEntry entry, @Context Providers providers) throws IOException {
        test = null;
        SyndContent content = entry.getContent();
        if (content == null) {
            return;
        }
        String value = content.getValue();
        String type = content.getType();
        if (value == null || !MediaType.APPLICATION_XML.equalsIgnoreCase(type)) {
            return;
        }
        // deserialize the defect xml
        test =
View Full Code Here

        public SyndEntry getDocument(@Context LinkBuilders linkBuilders, @Context UriInfo uriInfo) {
            SyndEntry entry = new SyndEntry("Test", "test:1", new Date());
            String baseUri = uriInfo.getBaseUri().toString();
            entry.setBase(baseUri);
            String path = uriInfo.getPath();
            entry.setContent(new SyndContent(path + "/csv", "text/csv", true));
            linkBuilders.createSystemLinksBuilder().relativize(false).build(entry.getLinks());
            return entry;
        }
View Full Code Here

            SyndFeed feed = new SyndFeed(new SyndText("Test"), "test:1", new Date());
            feed.setBase(uriInfo.getBaseUri().toString());

            SyndEntry entry = new SyndEntry(new SyndText("Test"), "test:1", new Date());
            URI requestUri = uriInfo.getAbsolutePath();
            entry.setContent(new SyndContent(requestUri + "/csv", "text/csv", true));
            feed.addEntry(entry);

            linkBuilders.createSystemLinksBuilder().relativize(false).build(feed.getLinks());
            linkBuilders.createSystemLinksBuilder().relativize(false)
                .resource(DocumentResource.class).build(entry.getLinks());
View Full Code Here

     *
     * @return the content of the resource - can be text,link or XML
     */
    public String getContent() throws IOException {

        SyndContent content = syndEntry.getContent();
        if (content != null) {

            String src = content.getSrc();
            if (src != null) {
                return src;
            }

            String type = content.getType();
            // TODO: get content using type?
            String value = String.valueOf(content.getValue());
            value = value != null ? value : ""; //$NON-NLS-1$
            if (type != null && (SyndTextType.xhtml.name().equals(type) || ModelUtils
                .isTypeXml(type))) {
                return StringEscapeUtils.escapeXml(value);
            }
View Full Code Here

    public void testAtomTo() throws Exception {

        SyndEntry entry1 = new SyndEntry();
        entry1.setId("12345");
        entry1.setBase("base1");
        entry1.setContent(new SyndContent("content"));
        entry1.setLang("en");
        entry1.addAuthor(new SyndPerson("Moshe Moshe"));
        entry1.addCategory(new SyndCategory("severity", "high", null));
        entry1.addCategory(new SyndCategory("author", "Moshe Moshe", null));

        SyndEntry entry2 = new SyndEntry();
        entry2.setId("54321");
        entry2.setBase("base2");
        entry2.setContent(new SyndContent("no content"));
        entry2.setLang("iw");
        entry2.addAuthor(new SyndPerson("Yosi Yosi"));
        entry2.addCategory(new SyndCategory("severity", "low", null));
        entry2.addCategory(new SyndCategory("author", "Yosi Yosi", null));
        entry2.addCategory(new SyndCategory("control", "No Control", null));
View Full Code Here

TOP

Related Classes of org.apache.wink.common.model.synd.SyndContent

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.