Examples of SyndLink


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

    }

    protected SyndFeed getSyndFeed(String path) {
        SyndFeed feed = new SyndFeed();
        feed.setTitle(new SyndText(""));
        feed.addLink(new SyndLink(AtomConstants.ATOM_REL_EDIT, null, path));
        return feed;
    }
View Full Code Here

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

                .getCollections(uriInfo)) {
                // only collection without template URI
                if (!isTemplateUri(subCollection.getUri())) {
                    SyndFeed subFeed = new SyndFeed();
                    subFeed.setTitle(new SyndText(subCollection.getTitle()));
                    subFeed.addLink(new SyndLink(AtomConstants.ATOM_REL_EDIT, null, subCollection
                        .getUri()));
                    collectionsList.add(subFeed);
                }
            }
            return collectionsList;
View Full Code Here

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

     * @throws WebApplicationException if neither the 'edit' nor the 'self'
     *             links exist.
     */
    private String getResourceLink(SyndBase synd) {
        // try 'edit' link
        SyndLink link = synd.getLink("edit");
        if (link == null) {
            // try 'self' link
            link = synd.getLink("self");
        }
        if (link == null) {
            // no link in the resource
            logger.error("The resource {} has set no edit or self link", synd.getId());
            throw new WebApplicationException();
        }

        URI uri = URI.create(link.getHref()).normalize();
        if (!uri.isAbsolute()) {
            // add base URI for relative links
            URI base = uriInfo.getAbsolutePath();
            if (synd.getBase() != null) {
                base = URI.create(synd.getBase());
View Full Code Here

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

     * @throws WebApplicationException if neither the 'edit' nor the 'self'
     *             links exist.
     */
    private String getResourceLink(SyndBase synd) {
        // try 'edit' link
        SyndLink link = synd.getLink("edit");
        if (link == null) {
            // try 'self' link
            link = synd.getLink("self");
        }
        if (link == null) {
            // no link in the resource
            logger.error(Messages.getMessage("webDAVNoEditOrSelfLink"), synd.getId());
            throw new WebApplicationException();
        }

        URI uri = URI.create(link.getHref()).normalize();
        if (!uri.isAbsolute()) {
            // add base URI for relative links
            URI base = uriInfo.getAbsolutePath();
            if (synd.getBase() != null) {
                base = URI.create(synd.getBase());
View Full Code Here

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

    private List<SyndLink> getLinksAsSynd() {
        List<SyndLink> authors = new ArrayList<SyndLink>();
        for (AtomLink value : getLinks()) {
            if (value != null) {
                authors.add(value.toSynd(new SyndLink()));
            }
        }
        return authors;
    }
View Full Code Here

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

        return build(out, builder);
    }

    private List<SyndLink> build(List<SyndLink> out, UriBuilder builder) {
        if (AtomConstants.ATOM_REL_SELF.equals(rel) || AtomConstants.ATOM_REL_EDIT.equals(rel)) {
            SyndLink link = getLink(out, rel);
            if (link != null) {
                out.remove(link);
            }
        }
        URI href = builder.buildFromEncodedMap(pathParams);
View Full Code Here

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

     * @throws WebApplicationException if neither the 'edit' nor the 'self'
     *             links exist.
     */
    private String getResourceLink(SyndBase synd) {
        // try 'edit' link
        SyndLink link = synd.getLink("edit"); //$NON-NLS-1$
        if (link == null) {
            // try 'self' link
            link = synd.getLink("self"); //$NON-NLS-1$
        }
        if (link == null) {
            // no link in the resource
            logger.error(Messages.getMessage("webDAVNoEditOrSelfLink", synd.getId())); //$NON-NLS-1$
            throw new WebApplicationException();
        }

        URI uri = URI.create(link.getHref()).normalize();
        if (!uri.isAbsolute()) {
            // add base URI for relative links
            URI base = uriInfo.getAbsolutePath();
            if (synd.getBase() != null) {
                base = URI.create(synd.getBase());
View Full Code Here

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

     * @throws WebApplicationException if neither the 'edit' nor the 'self'
     *             links exist.
     */
    private String getResourceLink(SyndBase synd) {
        // try 'edit' link
        SyndLink link = synd.getLink("edit"); //$NON-NLS-1$
        if (link == null) {
            // try 'self' link
            link = synd.getLink("self"); //$NON-NLS-1$
        }
        if (link == null) {
            // no link in the resource
            if (logger.isErrorEnabled()) {
                logger.error(Messages.getMessage("webDAVNoEditOrSelfLink", synd.getId())); //$NON-NLS-1$
            }
            throw new WebApplicationException();
        }

        URI uri = URI.create(link.getHref()).normalize();
        if (!uri.isAbsolute()) {
            // add base URI for relative links
            URI base = uriInfo.getAbsolutePath();
            if (synd.getBase() != null) {
                base = URI.create(synd.getBase());
View Full Code Here

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

            return;
        }
        if (syndFeed.getTitle() != null && syndFeed.getTitle().getValue() != null) {
            setTitle(syndFeed.getTitle().getValue());
        }
        SyndLink link = syndFeed.getLink("alternate");
        if (link != null && link.getHref() != null) {
            setLink(link.getHref());
        }
        if (syndFeed.getSubtitle() != null && syndFeed.getSubtitle().getValue() != null) {
            setDescription(syndFeed.getSubtitle().getValue());
        }
        if (syndFeed.getLang() != null) {
View Full Code Here

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

        }
        if (getTitle() != null) {
            syndFeed.setTitle(new SyndText(getTitle(), SyndTextType.text));
        }
        if (getLink() != null) {
            SyndLink syndLink = new SyndLink();
            syndLink.setHref(getLink());
            syndLink.setRel("alternate");
            syndFeed.getLinks().add(syndLink);
        }
        if (getDescription() != null) {
            syndFeed.setSubtitle(new SyndText(getDescription(), SyndTextType.text));
        }
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.