private boolean resourceLinkMatches(String theResourceName, ResourceLink theResourceLink, String theParamName) { return theResourceLink.getTargetResource().getResourceType().equalsIgnoreCase(theParamName) || theResourceLink.getSourcePath().equalsIgnoreCase(theResourceName+"."+theParamName); }
private ResourceLink createResourceLink(ResourceTable theEntity, Date theUpdateTime, IResourceLinkResolver theResourceLinkResolver, RuntimeSearchParam nextSpDef, String theNextPathsUnsplit, PathAndRef nextPathAndRef, IIdType theNextId, String theTypeString, Class<? extends IBaseResource> theType, String theId) { ResourceTable targetResource = theResourceLinkResolver.findTargetResource(nextSpDef, theNextPathsUnsplit, theNextId, theTypeString, theType, theId); if (targetResource == null) return null; ResourceLink resourceLink = new ResourceLink(nextPathAndRef.getPath(), theEntity, targetResource, theUpdateTime); return resourceLink; }
public ResourceLink(String theSourcePath, ResourceTable theSourceResource, IIdType theTargetResourceUrl, Date theUpdated) { super(); setSourcePath(theSourcePath); setSourceResource(theSourceResource); setTargetResourceUrl(theTargetResourceUrl); setUpdated(theUpdated); }
public ResourceLink(String theSourcePath, ResourceTable theSourceResource, ResourceTable theTargetResource, Date theUpdated) { super(); setSourcePath(theSourcePath); setSourceResource(theSourceResource); setTargetResource(theTargetResource); setUpdated(theUpdated); }
protected void validateOkToDelete(List<DeleteConflict> theDeleteConflicts, ResourceTable theEntity, boolean theForValidate) { TypedQuery<ResourceLink> query = myEntityManager.createQuery("SELECT l FROM ResourceLink l WHERE l.myTargetResourcePid = :target_pid", ResourceLink.class); query.setParameter("target_pid", theEntity.getId()); query.setMaxResults(1); List<ResourceLink> resultList = query.getResultList(); if (resultList.isEmpty()) { return; } if (myDaoConfig.isEnforceReferentialIntegrityOnDelete() == false && !theForValidate) { ourLog.debug("Deleting {} resource dependencies which can no longer be satisfied", resultList.size()); myResourceLinkDao.deleteAll(resultList); return; } ResourceLink link = resultList.get(0); IdDt targetId = theEntity.getIdDt(); IdDt sourceId = link.getSourceResource().getIdDt(); String sourcePath = link.getSourcePath(); theDeleteConflicts.add(new DeleteConflict(sourceId, sourcePath, targetId)); }
for (ResourceLink resourceLink : results) { if (theReverseMode) { pidsToInclude.add(resourceLink.getSourceResourcePid()); } else { pidsToInclude.add(resourceLink.getTargetResourcePid()); for (ResourceLink resourceLink : results) { if (theReverseMode) { Long pid = resourceLink.getSourceResourcePid(); if (pid != null) { pidsToInclude.add(pid); Long pid = resourceLink.getTargetResourcePid(); if (pid != null) { pidsToInclude.add(pid);
private boolean resourceIdMatches(ResourceLink theResourceLink, ReferenceParam theReference) { ResourceTable target = theResourceLink.getTargetResource(); IdDt idDt = target.getIdDt(); if (idDt.isIdPartValidLong()) { return theReference.getIdPartAsLong() == idDt.getIdPartAsLong(); } else { ForcedId forcedId = target.getForcedId(); if (forcedId != null) { return forcedId.getForcedId().equals(theReference.getValue()); } else { return false; } } }
protected void validateOkToDelete(List<DeleteConflict> theDeleteConflicts, ResourceTable theEntity, boolean theForValidate) { TypedQuery<ResourceLink> query = myEntityManager.createQuery("SELECT l FROM ResourceLink l WHERE l.myTargetResourcePid = :target_pid", ResourceLink.class); query.setParameter("target_pid", theEntity.getId()); query.setMaxResults(1); List<ResourceLink> resultList = query.getResultList(); if (resultList.isEmpty()) { return; } if (myDaoConfig.isEnforceReferentialIntegrityOnDelete() == false && !theForValidate) { ourLog.debug("Deleting {} resource dependencies which can no longer be satisfied", resultList.size()); myResourceLinkDao.deleteAll(resultList); return; } ResourceLink link = resultList.get(0); IdDt targetId = theEntity.getIdDt(); IdDt sourceId = link.getSourceResource().getIdDt(); String sourcePath = link.getSourcePath(); theDeleteConflicts.add(new DeleteConflict(sourceId, sourcePath, targetId)); }
for (ResourceLink resourceLink : results) { if (theReverseMode) { pidsToInclude.add(resourceLink.getSourceResourcePid()); } else { pidsToInclude.add(resourceLink.getTargetResourcePid()); for (ResourceLink resourceLink : results) { if (theReverseMode) { Long pid = resourceLink.getSourceResourcePid(); if (pid != null) { pidsToInclude.add(pid); Long pid = resourceLink.getTargetResourcePid(); if (pid != null) { pidsToInclude.add(pid);
if (linksForCompositePartWantPaths.contains(nextLink.getSourcePath())) { String value = nextLink.getTargetResource().getIdDt().toUnqualifiedVersionless().getValue(); if (isNotBlank(value)) { value = UrlUtil.escapeUrlParam(value);
ResourceLink resourceLink = new ResourceLink(nextPathAndRef.getPath(), theEntity, nextId, theUpdateTime); if (theParams.links.add(resourceLink)) { ourLog.debug("Indexing remote resource reference URL: {}", nextId); throw new InvalidRequestException(msg); } else { ResourceLink resourceLink = new ResourceLink(nextPathAndRef.getPath(), theEntity, nextId, theUpdateTime); if (theParams.links.add(resourceLink)) { ourLog.debug("Indexing remote resource reference URL: {}", nextId);
if (linksForCompositePartWantPaths.contains(nextLink.getSourcePath())) { String value = nextLink.getTargetResource().getIdDt().toUnqualifiedVersionless().getValue(); if (isNotBlank(value)) { value = UrlUtil.escapeUrlParam(value);