public List<Link> loadEmbeddedLinks(Gedcomx entity) { ArrayList<Link> embeddedLinks = new ArrayList<Link>(); Set<String> embeddedRels = getEmbeddedLinkRels(); List<Person> persons = entity.getPersons(); if (persons != null) { for (Person person : persons) { for (String embeddedRel : embeddedRels) { Link link = person.getLink(embeddedRel); if (link != null) { embeddedLinks.add(link); } } } } List<Relationship> relationships = entity.getRelationships(); if (relationships != null) { for (Relationship relationship : relationships) { for (String embeddedRel : embeddedRels) { Link link = relationship.getLink(embeddedRel); if (link != null) { embeddedLinks.add(link); } } } } return embeddedLinks; }
public RelationshipState readRelationship(Relationship relationship, StateTransitionOption... options) { Link link = relationship.getLink(Rel.RELATIONSHIP); link = link == null ? relationship.getLink(Rel.SELF) : link; if (link == null || link.getHref() == null) { return null; } ClientRequest request = createAuthenticatedGedcomxRequest().build(link.getHref().toURI(), HttpMethod.GET); return this.stateFactory.newRelationshipState(request, invoke(request, options), this.accessToken); }
public RelationshipState readRelationship(Relationship relationship, StateTransitionOption... options) { Link link = relationship.getLink(Rel.RELATIONSHIP); link = link == null ? relationship.getLink(Rel.SELF) : link; if (link == null || link.getHref() == null) { return null; } ClientRequest request = createAuthenticatedGedcomxRequest().build(link.getHref().toURI(), HttpMethod.GET); return this.stateFactory.newRelationshipState(request, invoke(request, options), this.accessToken); }
public RelationshipState readRelationship(Relationship relationship, StateTransitionOption... options) { Link link = relationship.getLink(Rel.RELATIONSHIP); link = link == null ? relationship.getLink(Rel.SELF) : link; if (link == null || link.getHref() == null) { return null; } ClientRequest request = createAuthenticatedGedcomxRequest().build(link.getHref().toURI(), HttpMethod.GET); return this.stateFactory.newRelationshipState(request, invoke(request, options), this.accessToken); }
public RelationshipState readRelationship(Relationship relationship, StateTransitionOption... options) { Link link = relationship.getLink(Rel.RELATIONSHIP); link = link == null ? relationship.getLink(Rel.SELF) : link; if (link == null || link.getHref() == null) { return null; } ClientRequest request = createAuthenticatedGedcomxRequest().build(link.getHref().toURI(), HttpMethod.GET); return this.stateFactory.newRelationshipState(request, invoke(request, options), this.accessToken); }
public RelationshipState removeRelationship(Relationship relationship, StateTransitionOption... options) { Link link = relationship.getLink(Rel.RELATIONSHIP); link = link == null ? relationship.getLink(Rel.SELF) : link; if (link == null || link.getHref() == null) { throw new GedcomxApplicationException("Unable to remove relationship: missing link."); } ClientRequest request = createAuthenticatedGedcomxRequest().build(link.getHref().toURI(), HttpMethod.DELETE); return this.stateFactory.newRelationshipState(request, invoke(request, options), this.accessToken); }
public RelationshipState removeRelationship(Relationship relationship, StateTransitionOption... options) { Link link = relationship.getLink(Rel.RELATIONSHIP); link = link == null ? relationship.getLink(Rel.SELF) : link; if (link == null || link.getHref() == null) { throw new GedcomxApplicationException("Unable to remove relationship: missing link."); } ClientRequest request = createAuthenticatedGedcomxRequest().build(link.getHref().toURI(), HttpMethod.DELETE); return this.stateFactory.newRelationshipState(request, invoke(request, options), this.accessToken); }
public RelationshipState removeRelationship(Relationship relationship, StateTransitionOption... options) { Link link = relationship.getLink(Rel.RELATIONSHIP); link = link == null ? relationship.getLink(Rel.SELF) : link; if (link == null || link.getHref() == null) { throw new GedcomxApplicationException("Unable to remove relationship: missing link."); } ClientRequest request = createAuthenticatedGedcomxRequest().build(link.getHref().toURI(), HttpMethod.DELETE); return this.stateFactory.newRelationshipState(request, invoke(request, options), this.accessToken); }
public RelationshipState removeRelationshipTo(Person spouse, StateTransitionOption... options) { Relationship relationship = findRelationshipTo(spouse); if (relationship == null) { throw new GedcomxApplicationException("Unable to remove relationship: not found."); } Link link = relationship.getLink(Rel.RELATIONSHIP); link = link == null ? relationship.getLink(Rel.SELF) : link; if (link == null || link.getHref() == null) { throw new GedcomxApplicationException("Unable to remove relationship: missing link."); } ClientRequest request = createAuthenticatedGedcomxRequest().build(link.getHref().toURI(), HttpMethod.DELETE); return this.stateFactory.newRelationshipState(request, invoke(request, options), this.accessToken); }
public RelationshipState removeRelationshipTo(Person parent, StateTransitionOption... options) { Relationship relationship = findRelationshipTo(parent); if (relationship == null) { throw new GedcomxApplicationException("Unable to remove relationship: not found."); } Link link = relationship.getLink(Rel.RELATIONSHIP); link = link == null ? relationship.getLink(Rel.SELF) : link; if (link == null || link.getHref() == null) { throw new GedcomxApplicationException("Unable to remove relationship: missing link."); } ClientRequest request = createAuthenticatedGedcomxRequest().build(link.getHref().toURI(), HttpMethod.DELETE); return this.stateFactory.newRelationshipState(request, invoke(request, options), this.accessToken); }
public RelationshipState removeRelationshipTo(Person child, StateTransitionOption... options) { Relationship relationship = findRelationshipTo(child); if (relationship == null) { throw new GedcomxApplicationException("Unable to remove relationship: not found."); } Link link = relationship.getLink(Rel.RELATIONSHIP); link = link == null ? relationship.getLink(Rel.SELF) : link; if (link == null || link.getHref() == null) { throw new GedcomxApplicationException("Unable to remove relationship: missing link."); } ClientRequest request = createAuthenticatedGedcomxRequest().build(link.getHref().toURI(), HttpMethod.DELETE); return this.stateFactory.newRelationshipState(request, invoke(request, options), this.accessToken); }
public FamilyTreeRelationshipState readRelationship(Relationship relationship, StateTransitionOption... options) { Link link = relationship.getLink(Rel.RELATIONSHIP); if (link == null || link.getHref() == null) { return null; } ClientRequest request = createAuthenticatedGedcomxRequest().build(link.getHref().toURI(), HttpMethod.GET); return ((FamilyTreeStateFactory)this.stateFactory).newRelationshipState(request, invoke(request, options), this.accessToken); }