use of org.jowidgets.cap.common.api.link.ILinkDeletion in project jo-client-platform by jo-source.
the class LinkDeleterServiceImpl method deleteDirectLinks.
private void deleteDirectLinks(final Collection<? extends ILinkDeletion> linksDeletions, final IExecutionCallback executionCallback) {
for (final ILinkDeletion linkDeletion : linksDeletions) {
final IBeanKey destinationKey = linkDeletion.getDestinationKey();
resetDirectLink(sourceProperties, destinationKey, linkedBeanAccess, executionCallback);
}
}
use of org.jowidgets.cap.common.api.link.ILinkDeletion in project jo-client-platform by jo-source.
the class LinkDeleterServiceImpl method deleteInverseDirectLinks.
private void deleteInverseDirectLinks(final Collection<? extends ILinkDeletion> linksDeletions, final IExecutionCallback executionCallback) {
for (final ILinkDeletion linkDeletion : linksDeletions) {
final IBeanKey sourceKey = linkDeletion.getSourceKey();
resetDirectLink(destinationProperties, sourceKey, sourceBeanAccess, executionCallback);
}
}
use of org.jowidgets.cap.common.api.link.ILinkDeletion in project jo-client-platform by jo-source.
the class LinkDeleterServiceImpl method deleteStandardLinks.
private void deleteStandardLinks(final Collection<? extends ILinkDeletion> linksDeletions, final IExecutionCallback executionCallback) {
final List<IBeanKey> sourceKeys = new LinkedList<IBeanKey>();
final List<IBeanKey> destinationKeys = new LinkedList<IBeanKey>();
final IFilterFactory filterFactory = CapCommonToolkit.filterFactory();
final IBooleanFilterBuilder linkReaderFilterBuilder = filterFactory.booleanFilterBuilder();
linkReaderFilterBuilder.setOperator(BooleanOperator.OR);
for (final ILinkDeletion linkDeletion : linksDeletions) {
final IBeanKey sourceKey = linkDeletion.getSourceKey();
final IBeanKey destinationKey = linkDeletion.getDestinationKey();
if (linkDeletion.deleteSource()) {
sourceKeys.add(sourceKey);
}
if (linkDeletion.deleteDestination()) {
destinationKeys.add(destinationKey);
}
linkReaderFilterBuilder.addFilter(createLinkFilter(sourceKey, destinationKey));
if (symmetric) {
linkReaderFilterBuilder.addFilter(createLinkFilter(destinationKey, sourceKey));
}
}
if (!linkReaderFilterBuilder.isEmpty()) {
deleteLinks(linkReaderFilterBuilder.build(), linksDeletions.size() * 10, executionCallback);
}
deleteKeys(destinationKeys, linkedDeleterService, executionCallback);
deleteKeys(sourceKeys, sourceDeleterService, executionCallback);
}
Aggregations