++maxID;
continue;
}
String docID = list.getListURL() + SPConstants.DOC_TOKEN
+ Integer.toString(maxID);
final SPDocument doc = new SPDocument(docID, list.getListURL(),
list.getLastModCal(), SPConstants.NO_AUTHOR,
SPConstants.OBJTYPE_LIST_ITEM,
list.getParentWebState().getTitle(), FeedType.CONTENT_FEED, SPType.SP2007);
doc.setAction(ActionType.DELETE);
doc.setParentList(list);
deletedDocs.add(doc);
// If this list can contain attachments, assume that
// each item had attachments and send delete feed
// for them.
if (list.canContainAttachments()) {
final List<String> attachments = list.getAttachmntURLsFor(Util.getOriginalDocId(docID, FeedType.CONTENT_FEED));
final String originalDocID = docID;
for (String attchmnt_url : attachments) {
docID = SPConstants.ATTACHMENT_SUFFIX_IN_DOCID + "["
+ attchmnt_url + "]" + originalDocID;
final SPDocument attchmnt = new SPDocument(docID,
list.getListURL(), list.getLastModCal(),
SPConstants.NO_AUTHOR, SPConstants.OBJTYPE_ATTACHMENT,
list.getParentWebState().getTitle(),
FeedType.CONTENT_FEED, SPType.SP2007);
attchmnt.setAction(ActionType.DELETE);
attchmnt.setParentList(list);
deletedDocs.add(attchmnt);
}
}
++maxID;
}
// If we have sent the complete delete feeds, send one
// more delete feed corresponding to the list itself.
// This is not required for alerts. For alerts, just
// ensure that no more documents are to be sent.
if (SPConstants.ALERTS_TYPE.equals(list.getType())
&& deletedDocs.size() == 0 && list.isCrawlQueueEmpty()) {
LOGGER.log(Level.INFO, "Deleting Alerts List for list/library ["
+ list.getListURL() + "]. ");
iter.remove();
keyMap.remove(list.getPrimaryKey());
} else if (maxID >= biggestID) {
String docID = null;
if (!list.isSiteDefaultPage()) {
docID = list.getListURL() + SPConstants.DOC_TOKEN
+ list.getPrimaryKey();
;
} else {
docID = list.getLastDocProcessed().getDocId();
}
final SPDocument doc = new SPDocument(docID, list.getListURL(),
list.getLastModCal(), SPConstants.NO_AUTHOR,
SPConstants.OBJTYPE_LIST_ITEM, list.getParentWebState()
.getTitle(), FeedType.CONTENT_FEED, SPType.SP2007);
doc.setAction(ActionType.DELETE);
doc.setParentList(list);
if (!list.isSendListAsDocument() || !isCrawlAspxPages()) {
// send the listState as a feed only if it was
// included (not excluded) in the URL pattern
// matching
// The other case is SharePoint admin has set a
// flag at site level to exclude ASPX pages from
// being crawled and indexed and hence no need
// send DELETE feed for List
if (list.isSiteDefaultPage()) {
doc.setToBeFed(true);
} else {
doc.setToBeFed(false);
}
LOGGER.log( Level.FINE, "List Document marked as not to be fed because ASPX pages are not supposed to be crawled as per exclusion patterns OR SharePoint site level indexing options ");
}
deletedDocs.add(doc);
}