Package org.cedj.geekseek.domain.model

Examples of org.cedj.geekseek.domain.model.Identifiable


        if(source == null) {
            return;
        }

        if(representation instanceof Identifiable) {
            Identifiable sourceObject = (Identifiable)representation;
            if(sourceObject.getId() != null) {
                representation.addLink(
                    generateResourceLink(
                        source,
                        sourceObject.getId(),
                        representation.getUriInfo()));
            }
        }
    }
View Full Code Here


    @Override
    public void appendLinks(LinkableRepresentation<?> representation) {
        if(!(representation instanceof Identifiable)) {
            return;
        }
        Identifiable sourceIdentifiable = (Identifiable)representation; // TODO: Remove need for cast

        Collection<RelationMatch> matches = service.getMatchingRelations(representation.getSourceType());

        for(RelationMatch target: matches) {
            UriBuilder buidler = representation.getUriInfo().getBaseUriBuilder().segment(
                                            "rel",
                                            getTypeName(target.getSourceModel()),
                                            sourceIdentifiable.getId(),
                                            target.getSource().getType(),
                                            getTypeName(target.getTargetModel()));

            // TODO: Dynamically lookup MediaType
            representation.addLink(
View Full Code Here

        RepresentationConverter<Object, Object> converter = locateCoverterForType(manager, targetRepo.getType());
        if(converter == null) {
            return Response.status(Status.INTERNAL_SERVER_ERROR).build();
        }

        Identifiable source = sourceRepo.get(sourceId);
        if(source == null) {
            return Response.status(Status.NOT_FOUND).build();
        }

        Collection<? extends Identifiable> targets = repositry.findTargets(source, relationship, targetRepo.getType());
View Full Code Here

        }

        // TODO: quick and dirty
        String targetId = findLastId(link.getHref());

        Identifiable source = sourceRepo.get(sourceId);
        Identifiable target = targetRepo.get(targetId);
        if(source == null || target == null) {
            return Response.status(Status.NOT_FOUND).build();
        }

        Relation relation = repositry.add(source, relationship, target);
View Full Code Here

        }

        // TODO: quick and dirty
        String targetId = findLastId(link.getHref());

        Identifiable source = sourceRepo.get(sourceId);
        Identifiable target = targetRepo.get(targetId);
        if(source == null || target == null) {
            return Response.status(Status.NOT_FOUND).build();
        }

        repositry.remove(source, relationship, target);
View Full Code Here

TOP

Related Classes of org.cedj.geekseek.domain.model.Identifiable

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.