final IAttachmentSource attachmentSource = toSource(geoResource, IAttachmentSource.class, monitor);
isFeatureEnabled = attachmentSource != null && attachmentSource.isEnabled();
if (isFeatureEnabled || isHotlinkEnabled) {
final String featureLabel = getFeatureLabel(geoResource, feature);
final IDocumentFolder folder = ShpDocFactory.createFolder(feature, featureLabel, attachmentSource);
if (isFeatureEnabled) {
// Set so that source's document list is same with folder's
folder.setDocuments(attachmentSource.getDocuments(feature, monitor));
}
if (isHotlinkEnabled) {
folder.insertDocuments(hotlinkSource.getDocuments(feature, monitor), 0);
}
items.add(folder);
}
}
final IDocumentSource docSource = toSource(geoResource, IDocumentSource.class, monitor);
isResourceEnabled = docSource != null && docSource.isEnabled();
if (isResourceEnabled) {
final IDocumentFolder folder = ShpDocFactory.createFolder(null, geoResource.getTitle(), docSource);
// Set so that source's document list is same with folder's
folder.setDocuments(docSource.getDocuments(monitor));
items.add(folder);
}
}
}